My networking seems to be totally screwed up.
This is why I want to understand how network setup on (K)Ubuntu is supposed to work. Which components are involved and how they are meant to work together.
I know this question and my problems create two totally different topics. Let's see how this discussion is going to be and then I clean up to make this thread as generic as possible or create two threads from it.
These are the issues I face:
The /var/lib/dhcp/dhclient.leases is regularly written with illegal 0x00 bytes in it, breaking the format.
I issue sudo dhclient -v
about 10 times every day. 50% it reports the file was broken before.
Sometimes it does not work, just doesn't get an answer from the fritz. But most of the time it does.
Often DNS is broken too. I just had to issue sudo systemctl restart systemd-resolved.service
. Immediately it worked again. Only to stop working a few minutes later. Again restarting. Works now.
I got several networks:
- Stock Fritzbox 7390 on 192.168.66.1 currently w/o DSL connection. This is where my local network resides. I only temporarily switch it on for printing and watching videos from my RaspPi/LibreElec.
- USB-Wifi-Dongle for connection to the Internet via Android Wifi Tethering.
- sometimes I attach a mobile network router instead of the Fritz. Sure I have to only connect one of them and I have to manually issue
dhclient
or turn off the nw switch for a minute to inform my PC about the change. When the mobile router is plugged in, I cannot reach my devices in the local network. But this probably is a shortcoming in the DNS server of the crappy mobile router (I don't know the model, sorry). it's not incredibly important.
I tried USB- and BT-Tethering, too. But this had similar problems plus connection or speed issues.
I usually only have one of the networks powered, in order to avoid collisions in config. (routing etc). But as you see, not even that helps. Probably because the network down
detection does not work as I am used to.
I was used to see eth0
go down when I shut down the nw switch it is attached to. But this does not happen any more. (Did behavior change?) It's still up and often still shows its old IP-address. Same for the wifi dongle. The networks show up in ifconfig
and dhclient
tries to fetch an IP even if each network is not connected to anything. (even if Wifi is disabled from KDE)
My system:
- Ubuntu 21.4 (hirsute), initially installed from 20.4 (focal)
- Kernel 5.11.0-38-generic
- glib-networking 2.66.0-2
- systemd 247.3-3ubuntu3.6
- dhclient 4.4.1
- Wifi dongle: ID 148f:7601 Ralink Technology, Corp. MT7601U Wireless Adapter
output of ifconfig with wifi attached, LAN powered off
eno1: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 00:d8:61:XX:XX:XX txqueuelen 1000 (Ethernet)
RX packets 7187407 bytes 2063185568 (2.0 GB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 27601991 bytes 39093376385 (39.0 GB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 16 memory 0xa1100000-a1120000
eno1:avahi: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 169.254.10.48 netmask 255.255.0.0 broadcast 169.254.255.255
ether 00:d8:61:2b:b6:5b txqueuelen 1000 (Ethernet)
device interrupt 16 memory 0xa1100000-a1120000
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Lokale Schleife)
RX packets 14656522 bytes 1156231455 (1.1 GB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 14656522 bytes 1156231455 (1.1 GB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlx0022c0a02353: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.43.229 netmask 255.255.255.0 broadcast 192.168.43.255
inet6 fe80::ba4b:XXXX:XXXX:XXXX prefixlen 64 scopeid 0x20<link>
ether 00:22:c0:XX:XX:XX txqueuelen 1000 (Ethernet)
RX packets 59979 bytes 14330813 (14.3 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 66901 bytes 45757319 (45.7 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0