Got a new router and my ubuntu computer is the only device on my network that can no longer connect to the internet. It's connected via ethernet.
I'm on 18.04.3 LTS and here's what my ip addr show looks like.
ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever
2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 40:8d:5c:75:5e:50 brd ff:ff:ff:ff:ff:ff inet 10.0.0.23/24 brd 10.0.0.255 scope global enp3s0 valid_lft forever preferred_lft forever inet 192.168.1.107/24 brd 192.168.1.255 scope global dynamic noprefixroute enp3s0 valid_lft 85443sec preferred_lft 85443sec inet6 fe80::a979:73f9:ca33:1a97/64 scope link noprefixroute valid_lft forever preferred_lft forever 1 3 Answers
It seems that you have 2 IP addresses assigned to enp3s0 interface:
inet 10.0.0.23/24 brd 10.0.0.255 scope global enp3s0
inet 192.168.1.107/24 brd 192.168.1.255 scope global dynamic noprefixroute enp3s0
The solution is to remove the fixed ip and just leave the dynamic one.
How to do this it depends on wether you have a server box or a desktop.
1.- SERVER:If you have a server you can use netplan. Go to /etc/netplan and "sudo nano" de yaml file.
It should look like:
network: version: 2 renderer: networkd ethernets: enp3s0: dhcp4: yes dhcp6: yes addresses: [10.0.0.23, ] gateway4: 10.0.0.1 nameservers: addresses: [8.8.8.8, 8.8.4.4]You should change it to this:
network: version: 2 renderer: networkd ethernets: enp3s0: dhcp4: yes dhcp6: yesThen run:
sudo netplan applyAnd to check everything is ok
ifconfig -a2.- DESKTOP:If you have a desktop, your yaml file should look like
network: version: 2 renderer: NetworkManager
That means that NetworkManager is taking care of the config and changes. You can use the nmcli command line to modify config, but for simplicity sake, you can go to the status bar (next to the clock) select networked inteface and configuration. There in wired section, click on the wheel and you should see the ethernet configuration. Tere you should change the ipv4 and ipv6 tabs and set automatic (dhcp) as the only option.
I got this problem as well and all I did to solve it was changing my mac address. I don't know if that applies to you but it's worth a try
run
sudo apt install macchangerit will prompt asking you if you want a new mac everytime you connect. If you select no, you will get your default mac everytime you connect. I would suggest yes
turn of your wifi/ethernet and run
macchanger -r enp3s0this can be any network device you use. Then turn it on again
Hope it helps, as I said, I'm not sure if it applies to you but it certainly fixed it for me.
I also had this problem on my home network. I suspect my ISP router, but Ubuntu has broken networks before. It could also be the network interface.
My crude solutions are :
- Schedule a weekly reboot and increase lease time to 8 days.
- Run a watchdog script from cron, to reboot after 3 failed (spaced) pings and shutdown after 2 consecutive reboots.
- Force valid_lft and preferred_lft to forever, to prevent the countdown.