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 1488715 - The Team MAC address seems to randomly change after every reboot or when the team is down/up cycled
Summary: The Team MAC address seems to randomly change after every reboot or when the ...
Keywords:
Status: CLOSED DUPLICATE of bug 1472965
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: NetworkManager
Version: 7.4
Hardware: x86_64
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Beniamino Galvani
QA Contact: Desktop QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-09-06 05:00 UTC by Venkatesh Kavtikwar
Modified: 2021-06-10 12:57 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-10-06 13:35:02 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Venkatesh Kavtikwar 2017-09-06 05:00:09 UTC
Description of problem:
The Team MAC address seems to randomly change after every reboot or when the team is down/up cycled

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

kernel- 3.10.0-693.el7.x86_64
NetworkManager-1.8.0-9.el7.x86_64
NetworkManager-team-1.8.0-9.el7.x86_64

OR

kernel-3.10.0-514.el7.x86_64
NetworkManager-1.8.0-9.el7.x86_64
NetworkManager-team-1.8.0-9.el7.x86_64


How reproducible:
Create a team interface in active backup mode and verify the mac address. Bring the interface down & then up or reboot the system, we will observe the change in MAC address.

Steps to Reproduce:

for x in 1 2 3 4 5; do nmcli conn down team0; sleep 5 ; nmcli conn up team0; ip l l team0; done | grep link/ether
    link/ether 32:23:7a:28:7c:63 brd ff:ff:ff:ff:ff:ff
    link/ether d6:fd:f0:27:d3:1b brd ff:ff:ff:ff:ff:ff
    link/ether 6a:4f:58:1d:37:bc brd ff:ff:ff:ff:ff:ff
    link/ether ca:7b:67:bc:f1:e6 brd ff:ff:ff:ff:ff:ff
    link/ether 12:2f:92:6b:dc:78 brd ff:ff:ff:ff:ff:ff

Actual results:
MAC address changes after every cycle or whenever the team interface goes down and come back up but this behaviour is not observed when we will restart the NetworkManager.


Expected results:
MAC address should be constant across the reboots.

Additional info:

Workaround as mentioned in earlier bugzilla 1424641 where is is mentioned that this has been fixed with latest NetworkManager but the problem remains same.


Add a file to /etc/NetworkManager/dispatcher.d

# cat /etc/NetworkManager/dispatcher.d/30-team0-link 
if [ $2 == "down" ]
then
   exit
fi

if [ $1 == "team0" ]
then
   /sbin/ip link set address 02:01:02:03:04:05 dev team0
fi


Make sure that the script is owned by root and not writeable by any other user or group, as per the NetworkManager man page in RHEL7.  The following commands can assist with this:

chown root /etc/NetworkManager/dispatcher.d/30-team0-link
chmod u+x /etc/NetworkManager/dispatcher.d/30-team0-link
chmod go-w /etc/NetworkManager/dispatcher.d/30-team0-link

Comment 2 Thomas Haller 2017-09-06 08:23:04 UTC
As far as I see, nothing indicates that the NetworkManager connection for the team interface specifies an explict MAC address.


For team, there are two ways. Either set "hwaddr" in the team JSON config: 

  nmcli connection modify "$TEAM0" team.config '{"hwaddr": "02:01:02:03:04:05", "runner": {"name": "activebackup"}}'

Or better: set ethernet.cloned-mac-address to a fixed address:

  nmcli connection modify "$TEAM0" ethernet.cloned-mac-address 02:01:02:03:04:05




Why do you expect the MAC address of the software device to be stable, if you don't configure it?



Using a dispatcher script seems a bad workaround, compared to explicitly configuring it in the connection. Is there some reason that doesn't work?

Comment 3 Venkatesh Kavtikwar 2017-09-08 03:51:52 UTC
Hello Thomas,

Thanks for the input and the workaround where we can add the hardware address to the team configuration which will give fix the problem.


So the query here is :-

- Is it expected to add the hardware address to team configuration file to get a fixed team mac addressing? and if so then what should be mac address provided at the time of a new team configuration?

Once the team is created and system assigned some random mac address we can pick that and modify the connection but what if we want to add it at the time of team connection creation?

- Please correct me here as I am still learning, is it an enhancement compare to bonding where teaming picks any random mac address than the one from any slave whereas in bonding, systems picks mac address from any of the slave and assign it to bond interface & keeps it same across the reboots.

So I am finding it a bit difficult to understand the use-case of this feature with teaming as it will be difficult to modify the every new team connection with the mac address generated by system.



Coming to the queries:-

Why do you expect the MAC address of the software device to be stable, if you don't configure it?

- Our most of the customers are familiar with bonding where the behaviour is, as soon as we create a new bond interface,  it picks the mac address of any slave or primary slave and keep it same across the reboots. Where we need not to add a hardware address explicitly to the configuration file until we want to have failover-mac. 


So would like to know more on the new feature.


As well, would like to know if there is any feature with teaming which allows us to fallback to similar behaviour as of bonding if not then can this be considered as a feature enhancement? Please share your thoughts on this.

Comment 4 Beniamino Galvani 2017-09-08 14:36:04 UTC
Hi Venkatesh,

when not explictily configured in the JSON or in the connection, the
team gets the MAC address of the first interface that gets
enslaved. The order in which NM enslaves interfaces is stable across
reboots and this should guarantee a stable MAC address for the team
interface.

However, there is currently a bug in NetworkManager-1.8.0-9 that makes
the MAC change when the connection is reactivated manually. See:

 https://bugzilla.redhat.com/show_bug.cgi?id=1472965

for more details. We plan to fix it in the 7.4.2 z-stream update; I
can provide a scratch build with the fix if your want to try it
earlier.

Also, consider that when doing:

 for x in 1 2 3 4 5; do nmcli conn down team0; sleep 5 ; nmcli conn up team0; ip l l team0; done | grep link/ether

the team connection is reactivated, but its slaves remain disconnected
(unless the connection has autoconnect-slaves=yes). When the team
interface has no slaves, it can't inherit a MAC and thus its MAC is
random until the first slave comes up. Probably you should do
something like:

 for x in 1 2 3 4 5; do nmcli conn down team0; sleep 5 ; nmcli conn up $slave_connection; ip l l team0; done | grep link/ether

because activating a slave also activates its master. Or, as
an alternative, configure the team to autoconnect the slaves:

 nmcli conection modify team0 connection.autoconnect-slaves 1

Comment 7 Venkatesh Kavtikwar 2017-09-22 21:40:22 UTC
Hello,

Thanks for the information and sorry for the late reply.

I have asked customer to upgrade the NetworkManager and share the result.

I will update the BZ as soon as I hear back from CU.

Thanks again for this.


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