Thank you both, quite obviously I visited those pages previously, but they do not provide solution to my enquiry.
I am not looking for ways how to set up DNS or dnsmasg, but either stop NetwokManager to use dnsmasg for ‘shared’ interfaces, or modify route so it correctly works with manual IP.
The config for eth0 is simple and the only difference is whether
method=shared
or method=manual
In both cases
$ nmcli
eth0: connected to LAN
"Realtek RTL8152"
ethernet (r8152), 00:E0:4C:36:00:8F, hw, mtu 1500
inet4 10.42.0.1/24
route4 10.42.0.0/24 metric 100
However, if method=shared
the networkmanager uses dnsmasq
$ lsof -nP -iTCP -sTCP:LISTEN
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
dnsmasq 4707 nobody 7u IPv4 16220 0t0 TCP 10.42.0.1:53 (LISTEN)
$ systemctl status NetworkManager
● NetworkManager.service - Network Manager
Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; preset: disab>
Active: active (running) since Mon 2023-01-16 17:30:22 UTC; 8min ago
Docs: man:NetworkManager(8)
Main PID: 2978 (NetworkManager)
Tasks: 4 (limit: 3272)
Memory: 24.5M
CPU: 4.007s
CGroup: /system.slice/NetworkManager.service
├─2978 /usr/bin/NetworkManager --no-daemon
└─4073 /usr/bin/dnsmasq --conf-file=/dev/null --no-hosts --keep-in-foreground >
and devices connected to eth0 can ping IP address on the internet.
If method=manual
networkmanager does not use dnsmasq, but no device connected to eth0 can ping IP on the internet.
$ lsof -nP -iTCP -sTCP:LISTEN
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
$ systemctl status NetworkManager
● NetworkManager.service - Network Manager
Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; preset: disab>
Active: active (running) since Mon 2023-01-16 18:00:27 UTC; 2h 22min ago
Docs: man:NetworkManager(8)
Main PID: 2970 (NetworkManager)
Tasks: 3 (limit: 3272)
Memory: 23.0M
CPU: 11.534s
CGroup: /system.slice/NetworkManager.service
└─2970 /usr/bin/NetworkManager --no-daemon
Without any success I have tried various options to stop NetworkManager to use dnsmasq (eg dns=none
in config file), if method=shared
it would always use dnsmasq for that interface.
IP route is always the same, regardless of method
used
$ ip route
default via 172.17.17.1 dev wlan0 proto dhcp src 172.17.17.151 metric 600
10.42.0.0/24 dev eth0 proto kernel scope link src 10.42.0.1 metric 100
172.17.17.0/24 dev wlan0 proto kernel scope link src 172.17.17.151 metric 600
Interestingly, it never displays wireguard connection, even though it is always on on the wlan0 or cdc-wdm0
Thus, my question how to somehow disable DNS/dnsmasq or set up route which would work.
Thank you for your time.