[Bug 2104155] Re: systemd-udev interferes with MAC addresses of interfaces
Nick Rosbrook
2104155 at bugs.launchpad.net
Fri Mar 28 20:03:05 UTC 2025
This is *probably* just the default behavior, i.e.
/usr/lib/systemd/network/99-default.link, kicking in since no MAC
address is initially assigned. Does the MAC actually change each boot,
or does udev assign the same one each boot?
> while we have a permanent Mac configured for that network interface
Where is this happening? How are you configuring this?
Some debug information would be helpful:
1) Debug logs from systemd-udevd:
$ mkdir -p /etc/systemd/system/systemd-udevd.service.d/
$ cat > /etc/systemd/system/systemd-udevd.service.d/debug.conf << EOF
[Service]
Environment=SYSTEMD_LOG_LEVEL=debug
$ reboot
...
$ journalctl -u systemd-udevd.service -b > udev.log
2) udevadm info
$ udevadm info /sys/class/net/ens192 > udevadm-info-ens192.txt
3) Any networkd configs for this device. E.g. files in
/etc/systemd/network/ or /run/systemd/network that are custom (or
generated by netplan) and related to your configuration.
Please attach the above debug output to this bug.
** Changed in: systemd (Ubuntu)
Status: New => Incomplete
** Also affects: systemd (Ubuntu Jammy)
Importance: Undecided
Status: New
** Changed in: systemd (Ubuntu Jammy)
Status: New => Incomplete
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/2104155
Title:
systemd-udev interferes with MAC addresses of interfaces
Status in systemd package in Ubuntu:
Incomplete
Status in systemd source package in Jammy:
Incomplete
Bug description:
While configuring a system based on ubuntu 22.04 version , we found
that a system-d udev rules assign a random mac address to one of the
network interfaces .
Kernel version
uname -a
5.15.0-25-generic #25-Ubuntu SMP Wed Mar 30 15:54:22 UTC 2022 x86_64
x86_64 x86_64 GNU/Linux
Ubunutu version
root at maglev-master-10-106-0-137:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.5 LTS
Release: 22.04
Codename: jammy
ip addr show output which shows the mac address has been changed
ens192: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master management state UP group default qlen 1000
link/ether d2:29:6b:94:be:bd brd ff:ff:ff:ff:ff:ff permaddr 00:50:56:b8:ed:a0
altname enp11s0
d2:29:6b:94:be:bd is being randomly assigned while permanent address
is 00:50:56:b8:ed:a0
root at maglev-master-10-106-0-137:~# ethtool -P ens192
Permanent address: 00:50:56:b8:ed:a0
PID: 1760 (snmpd) changed MAC to 00:00:00:00:00:00
PID: 1760 (snmpd) changed MAC to 00:00:00:00:00:00
PID: 15073 (systemd-udevd) changed MAC to d2:29:6b:94:be:bd
PID: 15073 (systemd-udevd) changed MAC to d2:29:6b:94:be:bd
PID: 15073 (systemd-udevd) changed MAC to d2:29:6b:94:be:bd
PID: 15084 (ip) changed MAC to d2:29:6b:94:be:bd
PID: 15084 (ip) changed MAC to d2:29:6b:94:be:bd
bpftrace output
Invoked kprobe:dev_set_mac_address_user with MAC d2:29:6b:94:be:bd
Stack trace:
dev_set_mac_address_user+1
rtnl_setlink+246
rtnetlink_rcv_msg+349
netlink_rcv_skb+83
rtnetlink_rcv+21
netlink_unicast+538
netlink_sendmsg+588
sock_sendmsg+98
__sys_sendto+275
__x64_sys_sendto+36
do_syscall_64+89
entry_SYSCALL_64_after_hwframe+68
systemd-udevd(7123) systemd-udevd(6656)
Invoked kprobe:dev_set_mac_address with MAC d2:29:6b:94:be:bd
Stack trace:
dev_set_mac_address+1
do_setlink+2217
rtnl_setlink+246
rtnetlink_rcv_msg+349
netlink_rcv_skb+83
rtnetlink_rcv+21
netlink_unicast+538
netlink_sendmsg+588
sock_sendmsg+98
__sys_sendto+275
__x64_sys_sendto+36
do_syscall_64+89
entry_SYSCALL_64_after_hwframe+68
systemd-udevd(7123) systemd-udevd(6656)
Invoked kprobe:bond_set_mac_address with MAC d2:29:6b:94:be:bd
Stack trace:
bond_set_mac_address+1
dev_set_mac_address_user+50
do_setlink+2217
rtnl_setlink+246
rtnetlink_rcv_msg+349
netlink_rcv_skb+83
rtnetlink_rcv+21
netlink_unicast+538
netlink_sendmsg+588
sock_sendmsg+98
__sys_sendto+275
__x64_sys_sendto+36
do_syscall_64+89
entry_SYSCALL_64_after_hwframe+68
ip(7137) sh(7135) python3(7013) twistd3(2045) web_install_ser(1959)
Invoked kprobe:dev_set_mac_address with MAC d2:29:6b:94:be:bd
Stack trace:
dev_set_mac_address+1
do_set_master+146
do_setlink+684
__rtnl_newlink+1560
rtnl_newlink+73
rtnetlink_rcv_msg+349
netlink_rcv_skb+83
rtnetlink_rcv+21
netlink_unicast+538
netlink_sendmsg+588
sock_sendmsg+98
____sys_sendmsg+590
___sys_sendmsg+129
__sys_sendmsg+98
__x64_sys_sendmsg+29
do_syscall_64+89
entry_SYSCALL_64_after_hwframe+68
ip(7137) sh(7135) python3(7013) twistd3(2045) web_install_ser(1959)
Invoked kprobe:vmxnet3_set_mac_addr with MAC d2:29:6b:94:be:bd
Stack trace:
vmxnet3_set_mac_addr+1
bond_enslave+1521
do_set_master+146
do_setlink+684
__rtnl_newlink+1560
rtnl_newlink+73
rtnetlink_rcv_msg+349
netlink_rcv_skb+83
rtnetlink_rcv+21
netlink_unicast+538
netlink_sendmsg+588
sock_sendmsg+98
____sys_sendmsg+590
___sys_sendmsg+129
__sys_sendmsg+98
__x64_sys_sendmsg+29
do_syscall_64+89
entry_SYSCALL_64_after_hwframe+68
Not able to understand why this systemd rule is triggering and
assigning MAC address randomly while we have a permanent Mac
configured for that network interface .
We found this reported issue in systemd .
https://github.com/systemd/systemd/issues/21185
https://github.com/systemd/systemd/commit/6d36464065601f79a352367cf099be8907d8f9aa
are they reason we are also running into the issue and if so, how do
we get away from this Other than setting MACAddressPolicy=none ?
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2104155/+subscriptions
More information about the foundations-bugs
mailing list