Today I setup a Pi 3B+ with the latest Raspbian Stretch image and recognized a strange behavior:

When initially looking at the network interfaces, the unpredictable network-interface naming was working as expected. My network-interface-names were lo, eth0 and wlan0. This is what I was expecting, as per default /etc/systemd/network/99-default.link is a symlink to /dev/null and thereby prevents the machine to use predictable interface names.

Then I full-disc encrypted the SD-card. More or less, I followed robpol86's really good tutorial on encrypting a Pi (see here: https://robpol86.com/raspberry_pi_luks.html).

Afterwards a strange behavior appeared: My eth0 interface now used a predictable name enxb827...

How is this possible, as /etc/systemd/network/99-default.link is still existing? Also I additionally tried to force the old behavior by adding net.ifnames=0 to /boot/cmdline.txt (and of course rebooting afterwards) but still without success.

I know that there is still another way to solve the problem which is for example given by this answer but I would prefer one of the previous ways, as giving one kernel flag or creating one symlink for me seems cleaner and more fault-tolerant in comparison to editing systemd-files.

Can someone explain to me why the first two solutions do not work anymore after I encrypted my system? Or is there a better way to enforce the old interface-naming? I do not want to use the new interface-names, as e.g. I have iptables rules which I want to use on multiple Pis without editing/templating them each time.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.