Hello. If i enable the type "virtio" for the interface card i only get this within the virtual machine: hostname ~ # udevadm test-builtin net_id /sys/class/net/eth0 2> /dev/null ID_NET_NAME_MAC=enx525400181683 In 80-net-name-slot.rules there are only this rules: NAME=="", ENV{ID_NET_NAME_ONBOARD}!="", NAME="$env{ID_NET_NAME_ONBOARD}" NAME=="", ENV{ID_NET_NAME_SLOT}!="", NAME="$env{ID_NET_NAME_SLOT}" NAME=="", ENV{ID_NET_NAME_PATH}!="", NAME="$env{ID_NET_NAME_PATH}" So it can not work. I don't know if this a kvm/libvirt or gentoo bug. But i thought i let you know. cheers t. Reproducible: Always
It's the designed behavior. From the referenced document: http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames See: <quote> 4. Names incorporating the interfaces's MAC address (example: enx78e7d1ea46da) 5- Classic, unpredictable kernel-native ethX naming (example: eth0) By default, systemd v197 will now name interfaces following policy 1) if that information from the firmware is applicable and available, falling back to 2) if that information from the firmware is applicable and available, falling back to 3) if applicable, falling back to 5) in all other cases. Policy 4) is not used by default, but is available if the user chooses so. </quote> as in, enx* is disabled by default, but you can have them if you enable them yourself by copying 80-net-name-slot.rules to /etc/udev/rules.d/ and modifying it there to use ID_NET_NAME_MAC right now it's correctly falling back to the kernel naming
Hello Samuli. I see. So there is no problem. :-) Should i open a kernel bug then? Or do you have an idea why there is no ID_NET_NAME_SLOT/ID_NET_NAME_PATH when i enable virtio? cheers t.
(In reply to comment #2) > Hello Samuli. > > I see. So there is no problem. :-) Should i open a kernel bug then? Or do > you have an idea why there is no ID_NET_NAME_SLOT/ID_NET_NAME_PATH when i > enable virtio? > > cheers > t. See the top of this file to see how SLOT and PATH construct: http://cgit.freedesktop.org/systemd/systemd/tree/src/udev/udev-builtin-net_id.c So I don't think it would be valid for virtio to have SLOT or PATH since it's not a real device. It really looks like MAC is the only attribute you can get out of virtio and correctly so. I don't think there is a bug at all, anywhere.
That's basically the same feedback I got from the people in #systemd when I asked the same question.