NetworkManager mishandles multiple interfaces on same subnet

Bug #1012211 reported by shifty on 2012-06-12
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Linux Mint
New
Undecided
Unassigned
Debian
New
Undecided
Unassigned
Fedora
Won't Fix
Undecided
network-manager (Ubuntu)
Undecided
Unassigned

Bug Description

1) The version and edition of Linux Mint you are using (if you are not sure, open a terminal and run "mintwelcome").

Release: 1 (debian)
Edition: Debian 64-bit

2) What you did for the problem to happen, and how to reproduce it.

In NetworkManager, I configured both wired and wireless network interfaces to connect to the same network. I set both interfaces to "Off" in NetworkManager. I then turned on and connected the wireless interface. After the wireless interface was connected, I turned on and connected the wired interface.

3) What happened.

When only the wireless network was connected, both the local subnet route and default route went over the wireless connect, the only one available. Upon connection of the wired interface, NetworkManager properly prioritizes the wired interface for the default route, but left the wireless network prioritized for the local subnet route. Here is an example of the improper routing table, notice that the route for wlan0 appears above the route for eth0:

default via 192.168.77.254 dev eth0 proto static
192.168.77.0/24 dev wlan0 proto kernel scope link src 192.168.77.41
192.168.77.0/24 dev eth0 proto kernel scope link src 192.168.77.40

This is due to the order of the routes in the routing table that results from the order that the network connects were enabled. If the order of connection is reversed, so are the local subnet routes, correcting the issue.

4) What you expected to happen instead.

I expected the wired network to be prioritized for both the default route and local subnet route, producing a routing table something like this:

default via 192.168.77.254 dev eth0 proto static
192.168.77.0/24 dev wlan0 proto kernel scope link src 192.168.77.41 metric 1
192.168.77.0/24 dev eth0 proto kernel scope link src 192.168.77.40 metric 0

5) If the problem happened once, sometimes, or always.

This problem always happens. At some point in the past the network routes were handled properly, producing a routing table that looked like this:

default via 192.168.77.254 dev wlan0 proto static metric 1
default via 192.168.77.254 dev eth0 proto static metric 0
192.168.77.0/24 dev wlan0 proto kernel scope link src 192.168.77.41 metric 1
192.168.77.0/24 dev eth0 proto kernel scope link src 192.168.77.40 metric 0

6) Possible relevant reference.

I found a NetworkManager a couple of bugs about this issue that indicates this is a problem with libnl3. Here is the NetworkManager bug report:
https://bugzilla.gnome.org/show_bug.cgi?id=659983
https://bugzilla.gnome.org/show_bug.cgi?id=659984

The second NetworkManager bug (659984) references a libnl mailing list message indicating a fix to the issue. Here is that post:
http://lists.infradead.org/pipermail/libnl/2011-October/000360.html

Description of problem:
If, while connected over wifi, ethernet connection is made, routing table is not properly updated

Version-Release number of selected component (if applicable):

How reproducible:
Every time

Steps to Reproduce:
1. Boot a laptop without ethernet, have it connected to a wifi network
2. Connect ethernet cable (same network)
3. Browse pages/check email/etc.

Actual results:
Wifi route is stuck as the default in the routing table, so network connection is not working right.

Expected results:
routing table should become exactly same as it would've been if laptop was booted up with wifi and ethernet enabled and plugged in, respectively.

Additional info:
Turning wifi off and then back on seems to work around the problem because the wifi interface gateway is removed when wifi is disabled. When re-added, wifi doesn't override ethernet gateway (correct behavior)

It works for me.
What NM version do you use?

Make sure "Use this connection only for resources on its networks" is not checked in the editor (IPv4 Settings, Routes...).

Would you, please, collect more information for us?
1. your connections data
nmcli -f connection,ipv4 con l id "your ethernet connection name"
nmcli -f connection,ipv4 con l id "your Wi-Fi connection name"

'never-default' option should be 'no'.

2. /var/log/messages

Download full text (9.1 KiB)

0.9.6.4
not checked

connection.id: Wired connection 1
connection.uuid: 8f8ffb67-599c-45fb-8c2d-98410ca064c1
connection.type: 802-3-ethernet
connection.autoconnect: yes
connection.timestamp: 1355487105
connection.read-only: no
connection.permissions:

connection.id: Auto CoRouter
connection.uuid: bf23e0e8-2ce4-4b80-8a8e-4ac8dca8303e
connection.type: 802-11-wireless
connection.autoconnect: yes
connection.timestamp: 1355486879
connection.read-only: no
connection.permissions:
ipv4.method: auto
ipv4.dns:
ipv4.dns-search:
ipv4.addresses:
ipv4.routes:
ipv4.ignore-auto-routes: no
ipv4.ignore-auto-dns: no
ipv4.dhcp-client-id: --
ipv4.dhcp-send-hostname: yes
ipv4.dhcp-hostname: --
ipv4.never-default: no
ipv4.may-fail: no

don't see a never-default option anywhere

on inserting the ethernet cable:

Dec 14 04:11:44 mireille kernel: [102378.251074] r8169 0000:05:00.0: p1p1: link up
Dec 14 04:11:44 mireille kernel: [102378.251096] IPv6: ADDRCONF(NETDEV_CHANGE): p1p1: link becomes ready
Dec 14 04:11:44 mireille NetworkManager[540]: <info> (p1p1): carrier now ON (device state 20)
Dec 14 04:11:44 mireille NetworkManager[540]: <info> (p1p1): device state change: unavailable -> disconnected (reason 'carrier-changed') [20 30 40]
Dec 14 04:11:44 mireille NetworkManager[540]: <info> Auto-activating connection 'Wired connection 1'.
Dec 14 04:11:44 mireille NetworkManager[540]: <info> Activation (p1p1) starting connection 'Wired connection 1'
Dec 14 04:11:44 mireille NetworkManager[540]: <info> (p1p1): device state change: disconnected -> prepare (reason 'none') [30 40 0]
Dec 14 04:11:44 mireille NetworkManager[540]: <info> Activation (p1p1) Stage 1 of 5 (Device Prepare) scheduled...
Dec 14 04:11:44 mireille NetworkManager[540]: <info> Activation (p1p1) Stage 1 of 5 (Device Prepare) started...
Dec 14 04:11:44 mireille NetworkManager[540]: <info> Activation (p1p1) Stage 2 of 5 (Device Configure) scheduled...
Dec 14 04:11:44 mireille NetworkManager[540]: <info> Activation (p1p1) Stage 1 of 5 (Device Prepare) complete.
Dec 14 04:11:44 mireille NetworkManager[540]: <info> Activation (p1p1) Stage 2 of 5 (Device Configure) starting...
Dec 14 04:11:44 mireille NetworkManager[540]: <info> (p1p1): device state change: prepare -> config (reason 'none') [40 50 0]
Dec 14 04:11:44 mireille NetworkManager[540]: <info> Activation (p1p1) Stage 2 of 5 (Device Configure) successful.
Dec 14 04:11:44 mireille NetworkManager[540]: <info> Activation (p1p1) Stage 3 of 5 (IP Configure Start) scheduled.
Dec 14 04:11:44 mireille NetworkManager[540]: <info> Activation (p1p1) Stage 2 of 5 (Device Configure) complete.
Dec 14 04:11:44 mireille NetworkManag...

Read more...

The issue seems to be that a metric is no-longer set for the routes:

Fedora 16:
$ ip route
default via 192.168.1.1 dev em1 proto static
192.168.1.0/24 dev em1 proto kernel scope link src 192.168.1.147 metric 1
192.168.1.0/24 dev wlan0 proto kernel scope link src 192.168.1.146 metric 9

Fedora 18 on the same hardware:
$ ip route
default via 192.168.1.1 dev em1 proto static
192.168.1.0/24 dev wlan0 proto kernel scope link src 192.168.1.146
192.168.1.0/24 dev em1 proto kernel scope link src 192.168.1.147

See also this nice write-up of the same symptoms on Linux Mint: https://bugs.launchpad.net/linuxmint/+bug/1012211

This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora
'version' of '17'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version prior to Fedora 17's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that
we may not be able to fix it before Fedora 17 is end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora, you are encouraged change the
'version' to a later Fedora version prior to Fedora 17's end of life.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Issue is still present on Fedora 18 (all updates applied)
Didn't test F19 yet, but probably same thing

This message is a reminder that Fedora 18 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 18. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora
'version' of '18'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version prior to Fedora 18's end of life.

Thank you for reporting this issue and we are sorry that we may not be
able to fix it before Fedora 18 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged change the 'version' to a later Fedora
version prior to Fedora 18's end of life.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Work for me in Fedora 19.

I'm in Fedora 20 now, pretty sure the bug is still present
Let me know if additional info is necessary

Fedora 18 changed to end-of-life (EOL) status on 2014-01-14. Fedora 18 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

This *was* a problem, got fixed and reappeared.

The original problem was fixed, for the regression please comment on bug 1050546 for F20, rawhide. Also see upstream bug at https://bugzilla.gnome.org/show_bug.cgi?id=723178

Launchpad Janitor (janitor) wrote :

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

Paul White (paulw2u) on 2016-05-29
affects: ubuntu → network-manager (Ubuntu)
Changed in network-manager (Ubuntu):
status: New → Confirmed
Changed in fedora:
importance: Unknown → Undecided
status: Unknown → Won't Fix
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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