In a nutshell:
# ip link set eth0 down # echo mem > /sys/power/state # ip link set eth0 up RTNETLINK answers: No such device
The problem
It may sometimes be helpful to put down an interface so it doesn’t interfere
with another one. Weirdly enough, if after doing so, the system is put through
a sleep (hibernation behaved the same if I remember correctly, so full power cut
off wasn’t helpful) ip link set eth0 up results in the following perplexing
message:
RTNETLINK answers: No such device
Hard to say what device is missing, but it’s not an error about an interface
because it is still listed by ip link.
The solution
At first I used the Windows-like approach of shutting down and booting again. It worked but caused inconvenience due to closing and restarting all applications.
Some time later I thought that “device” might be referring to something on the kernel side and tried unloading the module:
# modprobe -r igc # modprobe igc # ip link set eth0 up
This returns the interface (or the mysterious “device”) back to its normal operation every time.
The cause?
The behaviour looks like a Linux-side bug to me, but without testing on different hardware it’s hard to exclude a firmware- or hardware-related root cause. However, if restarting a module reliably helps, sounds like a driver could at least work around the issue.