Bug 1763734 - Support mac-address change for OVS interface
Summary: Support mac-address change for OVS interface
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: NetworkManager
Version: 8.0
Hardware: Unspecified
OS: Linux
unspecified
unspecified
Target Milestone: rc
: 8.2
Assignee: Beniamino Galvani
QA Contact: Desktop QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-10-21 13:21 UTC by Quique Llorente
Modified: 2020-04-28 16:53 UTC (History)
13 users (show)

Fixed In Version: NetworkManager-1.22.0-0.2.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-04-28 16:53:15 UTC
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:1847 0 None None None 2020-04-28 16:53:41 UTC

Description Quique Llorente 2019-10-21 13:21:06 UTC
Description of problem:

Changing 802-3-ethernet.mac-address property of an OVS interface take no effect at all, also nmcli shows no mac information at 802-3-ethernet.mac-address.


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

NetworkManager-1.20.5-1.27c23b0748.el7.x86_64
NetworkManager-ovs-1.20.5-1.27c23b0748.el7.x86_64

How reproducible:


Steps to Reproduce:

Create a ovs-bridge with ovs-port and ovs-interface:

nmcli conn add type ovs-bridge conn.interface bridge0
nmcli conn add type ovs-port conn.interface port0 master bridge0
nmcli conn add type ovs-interface slave-type ovs-port conn.interface iface0 \
  master port0 ipv4.method manual ipv4.address 192.0.2.1/24

# Actual mac 
ip link show ovs0
15: ovs0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/ether ae:7a:1e:41:f1:44

Change mac address of the ovs-interface

nmcli c modify ovs0 802-3-ethernet.mac-address ae:7a:1e:41:f1:45

Actual results:

nmcli c show ovs0 |grep mac
802-3-ethernet.mac-address:             AE:7A:1E:41:F1:45
802-3-ethernet.cloned-mac-address:      --
802-3-ethernet.generate-mac-address-mask:--
802-3-ethernet.mac-address-blacklist:   --

ip link show ovs0
15: ovs0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/ether ae:7a:1e:41:f1:44 brd ff:ff:ff:ff:ff:ff


Expected results:

nmcli c show ovs0 |grep mac
802-3-ethernet.mac-address:             AE:7A:1E:41:F1:45
802-3-ethernet.cloned-mac-address:      --
802-3-ethernet.generate-mac-address-mask:--
802-3-ethernet.mac-address-blacklist:   --

ip link show ovs0
15: ovs0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/ether ae:7a:1e:41:f1:45 brd ff:ff:ff:ff:ff:ff

Additional info:

Also 802-3-ethernet.mac-address is empty after ovs-interface creation.

Comment 1 Beniamino Galvani 2019-10-25 08:45:28 UTC
Note that the correct property to change the MAC address is 'ethernet.cloned-mac-address'. 'ethernet.mac-address' is used to match a specific device by MAC address (instead or in addition to 'connection.interface-name').

Currently the 'ethernet.cloned-mac-address'property is not applied for ovs bridges and ovs interfaces.
This is the upstream merge request to support it:

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/321

Comment 2 Edward Haas 2019-10-29 10:16:38 UTC
(In reply to Beniamino Galvani from comment #1)
> Currently the 'ethernet.cloned-mac-address'property is not applied for ovs
> bridges and ovs interfaces.

What is the meaning of specifing a MAC address on the bridge?
Unlike the Linux-Bridge model, OVS bridges in NM do not have a kernel interface representation. In order to have one, an internal interface needs to be defined.

Comment 3 Thomas Haller 2019-10-29 13:28:32 UTC
> What is the meaning of specifing a MAC address on the bridge?

Good point. I would guess having a MAC address only makes sense on the interfaces.

Comment 4 Beniamino Galvani 2019-11-04 09:35:27 UTC
(In reply to Edward Haas from comment #2)
> (In reply to Beniamino Galvani from comment #1)
> > Currently the 'ethernet.cloned-mac-address'property is not applied for ovs
> > bridges and ovs interfaces.
> 
> What is the meaning of specifing a MAC address on the bridge?
> Unlike the Linux-Bridge model, OVS bridges in NM do not have a kernel
> interface representation. In order to have one, an internal interface needs
> to be defined.

The bridge MAC property maps to the 'other_config : hwaddr' property of the Bridge table in ovs db. From 'man ovs-vswitchd.conf.db':

  other_config : hwaddr: optional string
    An Ethernet address in the form xx:xx:xx:xx:xx:xx to set the hardware address of the local port and influence the datapath ID.

As I understand from the man page and from empirical evidence, the local interface (the one named in the same way as the bridge) doesn't take the MAC set in the interface table, but the one set on the bridge.

Perhaps in NM we could have only the property on the interface (without the one on the bridge) and set it in the right place depending on the interface type (local or not), but that seems ugly because it's different from the ovs model. Also, the hwaddr property on the bridge influences the 'datapath ID' ... I don't know if that is useful or not, but is seems more correct to have properties that map to the ovs counterpart.

Comment 8 Vladimir Benes 2020-01-25 13:13:18 UTC
both situations covered
1. iface has the same name as a bridge (setting mac on the bridge)
     ovs_cloned_mac_with_the_same_bridge_iface_name
2. iface name differs from a bridge (setting mac on iface directly)
     ovs_cloned_mac_set_on_iface

both work well on all architectures.

Comment 10 errata-xmlrpc 2020-04-28 16:53:15 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:1847


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