Bug 1852106

Summary: NM OVS: DHCP occurs with incorrect MAC
Product: Red Hat Enterprise Linux 8 Reporter: Tim Rozet <trozet>
Component: NetworkManagerAssignee: Beniamino Galvani <bgalvani>
Status: CLOSED ERRATA QA Contact: Desktop QE <desktop-qa-list>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 8.2CC: acardace, atragler, bgalvani, dcbw, lrintel, rkhan, sukulkar, thaller, till, toneata, vbenes
Target Milestone: rcKeywords: ZStream
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: NetworkManager-1.26.0-0.2.1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1857775 (view as bug list) Environment:
Last Closed: 2020-11-04 01:50:15 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1857775    

Description Tim Rozet 2020-06-29 18:15:08 UTC
Description of problem:
When using an OVS interface with a cloned mac of the physical interface of the machine, DHCP uses the wrong MAC address. From my testing the MAC appears to be randomly chosen each time networking is turned off/on. Every once in a while, it will use the correct address.

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

How reproducible:
At least 50% of the time the wrong MAC is chosen.

Steps to Reproduce:
1. Create connections for configuring OVS with a physical interface attached:
nmcli c add type ovs-bridge conn.interface br-ex con-name br-ex
nmcli c add type ovs-port conn.interface br-ex-port master br-ex con-name ovs-port-br-ex
nmcli c add type ovs-interface slave-type ovs-port conn.interface br-ex-port master ovs-port-br-ex con-name ovs-if-br-ex 802-3-ethernet.cloned-mac-address 52:54:00:16:88:2b
nmcli c add type ovs-port conn.interface ens3 master br-ex con-name ovs-port-phys0
nmcli c add type 802-3-ethernet conn.interface ens3 master ovs-port-phys0 con-name ovs-if-phys0

2. turn off and on networking:
nmcli networking off
nmcli networking on


Actual results:
Random IP is assigned due to unknown MAC being used:

Jun 29 10:33:42 test-q9gz9-bootstrap NetworkManager[32858]: <trace> [1593426822.6508] device[84b7bd5379d23c8f] (br-ex-port): ip4-state: set to 2 (conf)
Jun 29 10:33:42 test-q9gz9-bootstrap NetworkManager[32858]: <debug> [1593426822.6508] device[84b7bd5379d23c8f] (br-ex-port): IPv4 config method is auto
Jun 29 10:33:42 test-q9gz9-bootstrap NetworkManager[32858]: <trace> [1593426822.6509] dbus-object[14f47596016f6ddd]: export: "/org/freedesktop/NetworkManager/DHCP4Config/7"
Jun 29 10:33:42 test-q9gz9-bootstrap NetworkManager[32858]: <debug> [1593426822.6510] device[84b7bd5379d23c8f] (br-ex-port): ipv4.dhcp-client-id: use "mac" client ID: 01:7e:4d:9c:20:dc:f5
Jun 29 10:33:42 test-q9gz9-bootstrap NetworkManager[32858]: <trace> [1593426822.6510] dhcp4: creating IPv4 DHCP client of type NMDhcpNettools
Jun 29 10:33:42 test-q9gz9-bootstrap NetworkManager[32858]: <info>  [1593426822.6511] dhcp4 (br-ex-port): activation: beginning transaction (timeout in 45 seconds)
Jun 29 10:33:42 test-q9gz9-bootstrap NetworkManager[32858]: <trace> [1593426822.6511] dhcp4 (br-ex-port): client-id: set 01:7e:4d:9c:20:dc:f5
Jun 29 10:33:42 test-q9gz9-bootstrap NetworkManager[32858]: <trace> [1593426822.6512] dhcp4 (br-ex-port): dhcp-client4: start 0x55eac96966f0
Jun 29 10:33:42 test-q9gz9-bootstrap NetworkManager[32858]: <trace> [1593426822.6513] device[84b7bd5379d23c8f] (br-ex-port): ip6-state: set to 2 (conf)
Jun 29 10:33:42 test-q9gz9-bootstrap NetworkManager[32858]: <debug> [1593426822.6513] device[84b7bd5379d23c8f] (br-ex-port): IPv6 config method is auto
Jun 29 10:33:42 test-q9gz9-bootstrap NetworkManager[32858]: <debug> [1593426822.6513] device[84b7bd5379d23c8f] (br-ex-port): will enable userland IPv6LL
Jun 29 10:33:42 test-q9gz9-bootstrap NetworkManager[32858]: <debug> [1593426822.6514] platform-linux: link: change 13: user-ipv6ll: set IPv6 address generation mode to none
Jun 29 10:33:42 test-q9gz9-bootstrap NetworkManager[32858]: <debug> [1593426822.6516] platform-linux: do-request-link: 13
Jun 29 10:33:42 test-q9gz9-bootstrap NetworkManager[32858]: <trace> [1593426822.6516] platform-linux: event-notification: RTM_NEWQDISC, flags 0, seq 706: noqueue dev 13 family 0 handle 0 parent ffffffff info 2
Jun 29 10:33:42 test-q9gz9-bootstrap NetworkManager[32858]: <debug> [1593426822.6516] platform: (br-ex-port) signal: qdisc   added: noqueue dev 13 family 0 handle 0 parent ffffffff info 2
Jun 29 10:33:42 test-q9gz9-bootstrap NetworkManager[32858]: <trace> [1593426822.6516] platform-linux: event-notification: RTM_NEWLINK, flags 0, seq 0: 13: br-ex-port <UP,LOWER_UP;broadcast,multicast,up,running,lowerup> mtu 1500 arp 1 openvswitch* not-init addrgenmode eui64 addr 52:54:00:16:88:2B brd FF:FF:FF:FF:FF:FF rx:0,0 tx:0,0
Jun 29 10:33:42 test-q9gz9-bootstrap NetworkManager[32858]: <debug> [1593426822.6516] platform: (br-ex-port) signal: link changed: 13: br-ex-port <UP,LOWER_UP;broadcast,multicast,up,running,lowerup> mtu 1500 arp 1 openvswitch* not-init addrgenmode eui64 addr 52:54:00:16:88:2B brd FF:FF:FF:FF:FF:FF driver openvswitch rx:0,0 tx:0,0
Jun 29 10:33:42 test-q9gz9-bootstrap NetworkManager[32858]: <debug> [1593426822.6517] device[84b7bd5379d23c8f] (br-ex-port): queued link change for ifindex 13
Jun 29 10:33:42 test-q9gz9-bootstrap NetworkManager[32858]: <trace> [1593426822.6517] platform-linux: event-notification: RTM_NEWLINK, flags 0, seq 0: 13: br-ex-port <UP,LOWER_UP;broadcast,multicast,up,running,lowerup> mtu 1500 arp 1 openvswitch* not-init addrgenmode none addr 52:54:00:16:88:2B brd FF:FF:FF:FF:FF:FF rx:0,0 tx:0,0
Jun 29 10:33:42 test-q9gz9-bootstrap NetworkManager[32858]: <debug> [1593426822.6517] platform: (br-ex-port) signal: link changed: 13: br-ex-port <UP,LOWER_UP;broadcast,multicast,up,running,lowerup> mtu 1500 arp 1 openvswitch* not-init addrgenmode none addr 52:54:00:16:88:2B brd FF:FF:FF:FF:FF:FF driver openvswitch rx:0,0 tx:0,0


Expected results:
To see DHCP request with MAC: 52:54:00:16:88:2b, which the DHCP server has a static entry for.

Additional info:
Upstream bug: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/483

Comment 1 Tim Rozet 2020-06-29 19:18:34 UTC
Note in addition to this behavior. I also see that even the interface sometimes gets the wrong mac address:

[core@test-q9gz9-bootstrap ~]$ ip a show br-ex
30: br-ex: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
    link/ether e2:e4:16:ac:b0:4c brd ff:ff:ff:ff:ff:ff
    inet 192.168.126.108/24 brd 192.168.126.255 scope global dynamic noprefixroute br-ex
       valid_lft 2779sec preferred_lft 2779sec
    inet6 fe80::83cc:2a30:8324:9b41/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever

The above interface got e2:e4... however:
[core@test-q9gz9-bootstrap ~]$ nmcli conn show ovs-if-br-ex | grep mac-address
802-3-ethernet.mac-address:             --
802-3-ethernet.cloned-mac-address:      52:54:00:16:88:2B
802-3-ethernet.generate-mac-address-mask:--
802-3-ethernet.mac-address-blacklist:   --

and in OVS:
[core@test-q9gz9-bootstrap ~]$ sudo ovs-vsctl list interface
_uuid               : 78972a20-99f7-4b26-84fb-7c11d1eb2e82
admin_state         : up
bfd                 : {}
bfd_status          : {}
cfm_fault           : []
cfm_fault_status    : []
cfm_flap_count      : []
cfm_health          : []
cfm_mpid            : []
cfm_remote_mpids    : []
cfm_remote_opstate  : []
duplex              : []
error               : []
external_ids        : {NM.connection.uuid="e999d8ab-c997-4056-b80d-5992d907e17e"}
ifindex             : 30
ingress_policing_burst: 0
ingress_policing_rate: 0
lacp_current        : []
link_resets         : 3
link_speed          : []
link_state          : up
lldp                : {}
mac                 : "52:54:00:16:88:2B"
mac_in_use          : "e2:e4:16:ac:b0:4c"
mtu                 : 1500
mtu_request         : []
name                : br-ex

Jun 29 13:46:29 test-q9gz9-bootstrap NetworkManager[32858]: <trace> [1593438389.2835] dbus-object[965b92ce33c5de54]: export: "/org/freedesktop/NetworkManager/DHCP4Config/17"
Jun 29 13:46:29 test-q9gz9-bootstrap NetworkManager[32858]: <debug> [1593438389.2836] device[c571e98b3b7fe327] (br-ex): ipv4.dhcp-client-id: use "mac" client ID: 01:e2:e4:16:ac:b0:4c
Jun 29 13:46:29 test-q9gz9-bootstrap NetworkManager[32858]: <trace> [1593438389.2836] dhcp4: creating IPv4 DHCP client of type NMDhcpNettools
Jun 29 13:46:29 test-q9gz9-bootstrap NetworkManager[32858]: <info>  [1593438389.2836] dhcp4 (br-ex): activation: beginning transaction (timeout in 45 seconds)
Jun 29 13:46:29 test-q9gz9-bootstrap NetworkManager[32858]: <trace> [1593438389.2836] dhcp4 (br-ex): client-id: set 01:e2:e4:16:ac:b0:4c
Jun 29 13:46:29 test-q9gz9-bootstrap NetworkManager[32858]: <trace> [1593438389.2837] dhcp4 (br-ex): dhcp-client4: start 0x55eac968c130

Comment 2 Beniamino Galvani 2020-07-01 11:35:35 UTC
Upstream merge request:

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/557

Comment 6 Tim Rozet 2020-07-03 19:18:43 UTC
The fix looks to be working. I tried configuring a bunch of times and nmcli networking off/on and it seems to be OK.

Comment 7 Tim Rozet 2020-07-03 19:32:54 UTC
I'm not sure if this is related or not, but it may be also using the wrong mac on reboot: https://bugzilla.redhat.com/show_bug.cgi?id=1853750

I tried using the proposed fix here and that did not fix this new bug.

Comment 14 Tim Rozet 2020-07-29 13:27:16 UTC
*** Bug 1853750 has been marked as a duplicate of this bug. ***

Comment 17 errata-xmlrpc 2020-11-04 01:50: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 (NetworkManager bug fix and enhancement update), 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:4499