I have configured systemd-networkd to change my Ethernet adapter's MAC address during boot. If I enter hibernate and then immediately resume my system, the following can be observed: 1. IP addresses on eth0 are still in place. 2. Routing tables are correct. 3. MAC address shown by ifconfig on eth0 is correct (I see the changed one). 3. I can't get the actual connectibity, for example ping my router UNLESS I issue this command: "ip link set address xx:xx:xx:xx:xx:xx dev eth0" MAC address entered here is the same that I see with ifconfig before executing the command. After that I can connect to any host anywhere immediately. I'm using gentoo-sources 3.17.4. This is my adapter's name shown by lspci: 07:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 06) Reproducible: Always Steps to Reproduce: 1. Hibernate 2. Resume
It looks to me like a kernel-space issue rather than systemd bug...
Kernel team, any ideas here?
Some corrections: actually the MAC address for eth0 on my machine during boot is not set by systemd-networkd, but by my custom unit. I made a mistake writing the original post because before I was changing the MAC for another interface (type veth) in .netdev file but then I found out it's not possible for physical adapter and wrote the custom unit: [Unit] Description=Set Custom MAC Address For eth0 Before=systemd-networkd.service [Service] Type=oneshot ExecStart=/bin/ip link set eth0 address 2a:5e:12:a0:bb:02 [Install] WantedBy=multi-user.target
Is this still valid with kernel >= 4.0.5 and systemd-225?
Yes, kernel 4.2.0 and systemd 225. I don't need this setup anymore but the problem remains. Modern test sequence: 1. Increase MAC by 1 with "ip link set address". 2. Hibernate. 3. Power on. 4. IPv4 address and routes are lost, IPv6 address and routes remain (SLAAC-configured, with custom token set on eth0 with "ip token"). 5. Ping my router with IPv6: address unreachable. 6. Restarting systemd-network does not update DHCP lease. 7. Issue the same "ip link set address" command again. 8. Ping with IPv6 works again and restarting systemd-networkd updates DHCP lease and restores routes.
I would suggest you contact some kernel devs and/or some systemd devs on this; it seems nobody at Gentoo has a clue on this.