Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 531838 - sys-apps/systemd - Network connectivity is lost after hibernate if Ethernet adapter MAC address was changed
Summary: sys-apps/systemd - Network connectivity is lost after hibernate if Ethernet a...
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo systemd Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-06 19:50 UTC by Pavel Volkov
Modified: 2018-02-26 22:09 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Volkov 2014-12-06 19:50:03 UTC
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
Comment 1 Pavel Volkov 2014-12-06 21:36:01 UTC
It looks to me like a kernel-space issue rather than systemd bug...
Comment 2 Mike Gilbert gentoo-dev 2014-12-07 16:52:31 UTC
Kernel team, any ideas here?
Comment 3 Pavel Volkov 2014-12-14 09:46:26 UTC
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
Comment 4 Pacho Ramos gentoo-dev 2015-09-07 18:35:23 UTC
Is this still valid with kernel >= 4.0.5 and systemd-225?
Comment 5 Pavel Volkov 2015-09-08 17:15:57 UTC
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.
Comment 6 Mike Gilbert gentoo-dev 2016-05-30 14:10:52 UTC
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.