Sample Header Ad - 728x90

network interfaces rename not working as expected. Where to look?

3 votes
1 answer
4247 views
System is Ubuntu 16.10. It has been updated quite some times, so it might have some remaining stuff from earlier versions in there (at least back till 14.04, probably much longer). The issue it the following: I have two network interfaces in the system (on mainboard). One was always named eth0. The second was not in use. Now I have a new situation in my network and want to use the second interface. I learned a lot about interface rename and the new rename rules. So the second interface choses the name enp5s0 or similar, can't remember, therefore I need to rename it. But here is where my trouble starts. eth0 was handled in /etc/udev/rules.d/70-persistent-net.rules which, I learned, is deprecated. I tried to add a second rule for "eth1" there (using its mac instead the one of eth0), but it did not work. So after reading a bit I got rid of the old file and maybe I misunderstood something, but I figured eth* names are discouraged today, so I've chosen to call them lan0 and lan1 (which describes what they will be used for). Then I added new files in /etc/systemd/network:
10-eth-lan0.link
10-eth-lan1.link
With this content:
[Match]
MACAddress=00:23:54:96:74:07/06

[Link]
Name=lan0/1
for the different MACAddresses and the different names. For eth0 this seems to work, for eth1 (or whatever reason) it does not. And I am quite puzzled why the heck it won't work. I tripple checked the mac. dmesg | grep eth shows me this:
[    6.233684] sky2 0000:08:00.0 eth0: addr 00:23:54:96:74:07
[    6.233975] sky2 0000:05:00.0 eth1: addr 00:23:54:96:74:06
[    6.661954] sky2 0000:08:00.0 lan0: renamed from eth0
[    8.513836] sky2 0000:05:00.0 rename3: renamed from eth1
I have absolutely no clue why it settled for "rename3" now... I experimented a bit with ip link set name after I saw the systemd link file not working. What puzzles me most is that it works for eth0 -> lan0 but not for eth1 -> lan1. What can I look into to find out why the rename is not working? Who is caching stuff here? The "ip link set name" did have some persistent effects (like the change to "rename3" from the enp5s0 or similar). [edit] I recognized one more thing now: My loopback interface gets renamed to lan1. Don't know why. But it happens on every boot now. Also I got rid of the *.link files described above and the renames still happen just the same.... ??? In /etc there is now just one mention of lan0 in /etc/network/interfaces and no mention of lan1. Somebody stores that stuff somewhere and I don't know who or where.
Asked by Garfonso (31 rep)
Feb 26, 2017, 08:18 PM
Last activity: May 21, 2025, 07:07 PM