RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1473952 - Reconnect interface to a new master
Summary: Reconnect interface to a new master
Keywords:
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
medium
medium
Target Milestone: rc
: ---
Assignee: Beniamino Galvani
QA Contact: Desktop QE
URL:
Whiteboard:
Depends On:
Blocks:
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:
Environment:
Last Closed: 2018-03-24 09:44:44 UTC
Target Upstream Version:
Embargoed:


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:
Always

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
    })
})
settings.AddConnection(ethernet_conn_settings)
settings.AddConnection(bridge_conn_settings)

import time
time.sleep(10)

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'])
ethernet_conn_settings['connection'].update({
    'slave-type': 'bond',
    'master': 'bond1',
    'uuid': ethernet_conn_uuid
})
ethernet_conn.Update(ethernet_conn_settings)
settings.AddConnection(bond_conn_settings)

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:

https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=632dd26288601c8564e1363f9bbf2f1f96d2dc53

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:

https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=0922a177385be188b9c9c8ad39c1068533f5a4b3

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
wrong.

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.