network manager assigns ethernet default route metric of 20100

Bug #1788659 reported by Josh Hill
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
network-manager (Ubuntu)
Triaged
Undecided
Unassigned

Bug Description

After upgrading from 16.04 to 18.04, when I boot with an ethernet cable connected, Ubuntu prefers to use the wifi interface over the ethernet interface. Wifi is assigned the normal metric of 600 for both of its routing table entries. However ethernet is assigned a metric of 20100.

I edited the connection details via nmcli to manually set the ethernet metric to 100. After a reboot, the link route (for the LAN subnet) correctly has a metric of 100. But the default route for eth0 is still 20100.

nm-applet shows the wifi icon, correctly indicating that the default route is over wifi rather than ethernet. The only fix is to manually set the route after every reboot, or turn off wifi. This is a regression from 16.04.

network-manager 1.10.6-2ubuntu1

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in network-manager (Ubuntu):
status: New → Confirmed
Revision history for this message
Alexander Karlstad (alexander.karlstad) wrote :

I have seen this for quite some time as well. Usually connected to both wifi and cabled network at work (while laptop is docked), which is quite handy for when I go to meetings and undock my laptop, but will stay online since I am also on wifi.

After a while though, and after re-docking the laptop, the metric for the connections change and the wifi takes priority (eth0 gets 20100 metric, wifi stays on 600). I am still online though, but the wifi is quite a bit slower at times.

Solution for now is to manually re-click my wired connection in nm-applet, or just disable auto-connect of the wifi altogether at work.

Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

This is working as designed.

NetworkManager now uses a metric "penalty" when connectivity cannot be detected as full for a connection, and reduces the metric accordingly.

This makes it so that if you're connected to both wired and wireless, and your wired connection becomes bad but the wireless connection remains, you should retain connectivity.

Similarly, if you need to use your own custom routes to use alternative paths to be online, this makes sure this alternative can be used automatically (the lowest metric is what gets used).

You may be able to avoid this issue by removing package 'network-manager-config-connectivity-ubuntu' from your system if it is installed -- disabling connectivity checking, which will avoid going through these code paths.

Changed in network-manager (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Marking Incomplete for now, in case there's more to it than a connectivity checking issue.

Revision history for this message
Josh Hill (ingenium) wrote :

I eventually figured out that's what was happening. However, the connectivity check is not working correctly. In my case, there is indeed ethernet connectivity, despite it thinking that there isn't. It will assign the network "penalty" metric even when ethernet has been connected for 30+ minutes, so something is causing it to incorrectly fail the connectivity check. If I override the metric manually, it works and uses ethernet, so there is not a problem with the connection.

Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Whether it's been running for 30 minutes or not doesn't change much though; the connection *can* fail, and the connectivity checking is a pretty simple HTTP check.

Could you please attach debug logs for NetworkManager (with the connectivity checking enabled) -- see https://wiki.gnome.org/Projects/NetworkManager/Debugging#Other_NetworkManager_Debugging.

Better yet, please file this bug upstream with NetworkManager developers at https://bugzilla.gnome.org/page.cgi?id=browse.html&product=NetworkManager to describe the issue, and see if there's anything they can do to improve the situation.

Thanks!

Changed in network-manager (Ubuntu):
status: Incomplete → Triaged
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.