You are not logged in.

#1 2022-01-19 06:15:26

Xenograph
Member
Registered: 2015-01-22
Posts: 9

systemd netdev MAC address changed with no explanation

Recently the MAC address of my systemd netdev "br0" changed without explanation. Documentation suggests that, if not explicitly set, the device's MAC address should be generated deterministically based on the systemd machine-id and the interface name.

Neither the machine-id nor the interface name have been modified in years. The only significant event that happened between the old and new MAC address appearing was that I disconnected my SSD and HDD, shipped my desktop cross-country, and reconnected them at the destination.

I noticed the MAC address was different when my router's DHCP suddenly assigned it a new IP address other than the one I had configured. I compared the MAC address in the DHCP configuration of my router to the current MAC address shown in "ip addr" for my br0 device.

In /etc/systemd/network I have three files:
bind.network

[Match]
Name=enp4s0

[Network]
Bridge=br0

Bridge.netdev

[NetDev]
Name=br0
Kind=bridge

bridge.network

[Match]
Name=br0

[Network]
DHCP=ipv4

What could possibly explain the new MAC address?

Offline

#2 2022-01-19 08:11:41

seth
Member
Registered: 2012-09-03
Posts: 50,927

Re: systemd netdev MAC address changed with no explanation

grep -ir mac /{etc,usr/lib}/systemd/network/

I disconnected my SSD and HDD, shipped my desktop cross-country, and reconnected them at the destination

Is the MAC still determinisitic?
If so, did the machine-id or interface name maybe change?

Offline

#3 2022-01-21 06:03:40

Xenograph
Member
Registered: 2015-01-22
Posts: 9

Re: systemd netdev MAC address changed with no explanation

I'm not sure if it is deterministic, but I would assume so. Even if not, what would've prompted it to regenerate?

Neither the machine-id nor the interface name have changed in years, as confirmed by file mtime.

❯ grep -ir mac /etc/systemd/network/

❯ grep -ir mac /usr/lib/systemd/network/
/usr/lib/systemd/network/99-default.link:MACAddressPolicy=persistent

❯ ls -la /etc/machine-id
-r--r--r-- 1 root root 33 Nov 15  2019 /etc/machine-id

❯ ls -la /etc/systemd/network
total 20
drwxr-xr-x 2 root root 4096 Nov 15  2019 .
drwxr-xr-x 5 root root 4096 Jan  3 18:56 ..
-rw-r--r-- 1 root root   42 Jun 23  2020 bind.network
-rw-r--r-- 1 root root   30 Nov 15  2019 Bridge.netdev
-rw-r--r-- 1 root root   38 Nov 15  2019 bridge.network

Last edited by Xenograph (2022-01-21 06:06:22)

Offline

#4 2022-01-21 15:24:19

seth
Member
Registered: 2012-09-03
Posts: 50,927

Re: systemd netdev MAC address changed with no explanation

Does this also meet a systemd update?
https://github.com/systemd/systemd/comm … rc/network has an entire flurry of commits messing around w/ this, esp. last December…

Offline

#5 2022-01-23 18:46:15

jstephenson
Member
Registered: 2022-01-23
Posts: 1

Re: systemd netdev MAC address changed with no explanation

I've recently experienced exactly the same thing on a machine that's had a stable bridge MAC since 2015, so it's not just you!

Offline

Board footer

Powered by FluxBB