Bug 1473952 - Reconnect interface to a new master
Summary: Reconnect interface to a new master
Status: CLOSED DUPLICATE of bug 1548265
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: NetworkManager
Version: 7.3
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Beniamino Galvani
QA Contact: Desktop QE
Depends On:
TreeView+ depends on / blocked
Reported: 2017-07-22 17:41 UTC by Petr Horáček
Modified: 2018-03-24 09:44 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2018-03-24 09:44:44 UTC
Target Upstream Version:

Attachments (Terms of Use)

Description Petr Horáček 2017-07-22 17:41:24 UTC
Description of problem:
When changing an 802-3-ethernet connection's master from bridge to a bond it is not reconnected unless reactivated explicitly (although 802-3-ethernet connection has autoconnect set to true and bond connection has autoconnect-slaves set to 1). Not sure if it is a bug, mistake in config or a missing feature.

Version-Release number of selected component (if applicable):
CentOS Linux release 7.3.1611 (Core)
NetworkManager 1.4.0

How reproducible:

Steps to Reproduce:
1. Create an 802-3-ethernet and bridge connections, 802-3-ethernet connection master is set to the bridge.
2. Interfaces are now autoconnected eth0-br1
3. Create a new connection for bond and change 802-3-ethernet connection master to this new bond.

Actual results:
802-3-ethernet master is still set to bridge.

Expected results:
802-3-ethernet master is set to bond1.

Reproducer script:
import uuid
import dbus

bus = dbus.SystemBus()
proxy = bus.get_object('org.freedesktop.NetworkManager', '/org/freedesktop/NetworkManager/Settings')
settings = dbus.Interface(proxy, 'org.freedesktop.NetworkManager.Settings')

ethernet_conn_settings = dbus.Dictionary({
    'connection': dbus.Dictionary({
        'id': 'test-eth0',
        'interface-name': 'eth0',
        'uuid': str(uuid.uuid4()),
        'type': '802-3-ethernet',
        'autoconnect': True,
        'autoconnect-priority': 100,
        'master': 'br0',
        'slave-type': 'bridge'
bridge_conn_settings = dbus.Dictionary({
    'connection': dbus.Dictionary({
        'id': 'test-br0',
        'interface-name': 'br0',
        'uuid': str(uuid.uuid4()),
        'type': 'bridge',
        'autoconnect': True,
        'autoconnect-priority': 100,
        'autoconnect-slaves': True

import time

bond_conn_settings = dbus.Dictionary({
    'connection': dbus.Dictionary({
        'id': 'test-bond1',
        'interface-name': 'bond1',
        'uuid': str(uuid.uuid4()),
        'type': 'bond',
        'autoconnect': True,
        'autoconnect-priority': 100,
        'master': 'br0',
        'slave-type': 'bridge',
        'autoconnect-slaves': True
ethernet_conn = None
ethernet_conn_uuid = None
for conn in settings.ListConnections():
    con_proxy = bus.get_object('org.freedesktop.NetworkManager', conn)
    settings_connection = dbus.Interface(con_proxy, 'org.freedesktop.NetworkManager.Settings.Connection')
    config = settings_connection.GetSettings()
    if str(config['connection']['id']) == 'test-eth0':
        ethernet_conn = settings_connection
        ethernet_conn_uuid = str(config['connection']['uuid'])
    'slave-type': 'bond',
    'master': 'bond1',
    'uuid': ethernet_conn_uuid

After running this `ip link` returns:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UP mode DEFAULT qlen 1000
    link/ether 52:54:00:e6:eb:82 brd ff:ff:ff:ff:ff:ff
3: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT qlen 1000
    link/ether 52:54:00:e6:eb:82 brd ff:ff:ff:ff:ff:ff
4: bond1: <NO-CARRIER,BROADCAST,MULTICAST,MASTER,UP> mtu 1500 qdisc noqueue master br0 state DOWN mode DEFAULT qlen 1000
    link/ether 8e:9c:29:a5:54:4d brd ff:ff:ff:ff:ff:ff

ethernet connection:
[root@localhost tmp]# nmcli con show test-eth0 
connection.master:                      bond1
connection.slave-type:                  bond

Comment 2 Beniamino Galvani 2017-07-26 14:43:16 UTC
This is probably fixed by commit:


Can you please try with a NetworkManager version that includes the commit (>= 1.6.0)? Thanks!

Comment 3 Petr Horáček 2017-08-01 19:42:16 UTC
Unfortunately, it is reproducible with NetworkManager-1.8.2-1.fc26.x86_64 as well.

Comment 4 Beniamino Galvani 2017-08-31 14:10:50 UTC
For the record, the script works with NM 1.8.0 but does not with 1.8.2 due to the following commit:


Comment 5 Beniamino Galvani 2017-09-28 12:30:03 UTC
In general when a connection is changed the new settings are effective
only after reactivation of the connection. Here the master of a slave
connection is changed while the connection is active and then the new
master (with autoconnect-slaves=yes) is brought up. The question is
whether NM should automatically reactivate the slave connection on the
new master.

In version 1.8.0, NM would unconditionally reactivate the slave when
autoconnect-slaves=yes. We noticed that this could lead to race
conditions: for example if a user activated the master and the slave
within short time, the slave auto-activation could preempt th slave
activation requested by user and make it fail, which is certainly

This scenario was fixed in 1.8.2 and now NM doesn't disconnect an
active connection just to auto-connect it again. I believe this is an
acceptable behavior and I would suggest to change the script to
explicitly reactivate a connection when changes are done to it.

Any other opinions about this?

Comment 6 Beniamino Galvani 2018-03-24 09:44:44 UTC

*** This bug has been marked as a duplicate of bug 1548265 ***

Note You need to log in before you can comment on or make changes to this bug.