User-Mode Linux: Has udev rules got you in a SIOCSIFADDR bind?

Although fresh and new stuff is not all that bad, someone needs to bring some balance to the source.

UML Booting....

SIOCSIFADDR: no such device
eth0: unknown interface: no such device
SIOCSIFNETMASK: no such device
SIOCADDRT: Network is unreachable

Uh Oh..

Sometimes when you build VM's (Virtual Machines) you have to move tuned and tested servers over to new computing bases with a different version of the previous OS. It is during this process when errors are likey to occur. I have built many machines on some older SuSE platforms, they work really well and give mostly solid performance. I prefer to stick to the same Linux flavor for ease of migration and less headaches. I am a believer in 'if it aint broke - don't fix it', so instead of rebuilding from scratch, sometimes I just move a perfectly tunned VM server to another well provisioned piece of hardware. It was during one of these moves when I got the dreaded "SIOCSIFADDR: no such device" error, then, in an instant - I had no network connectivity! Luckily the fix was not really difficult. If your not used to the new 'predictable' biosdev naming conventions of en, ens, enp, enx and relish the old ways of the Jedi knights of the republic..oh wait, got a little side tracked there. If you like the old unpredictable kernel-native eth0 etc. etc. names then one solution follows.

In my case, my previous NIC named eth0 was now named ens0. This little naming change broke my older scripts. Now there are a few different ways to remedy this error, I chose the path of least resistance on this one.

  • 1) Use 'yast' for steps 2 and 3, by selecting Network Devices and edit the device name in the Hardware Tab OR manually
  • 2) Rename /etc/sysconfig/network/ifcfg-"iface" to your desired name i.e. ifcfg-eth0, then
  • 3) Edit the /etc/udev/rules.d/70-persistent--net.rules file with the following:
  • SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="your MAC ID", ATTR{type}=="1", NAME=="eth0"
  • 4) Next manually disable biosdevname'ing' on the kernel command line by editing the /boot/grub2/grub.cfg file and append the following:
  • net.ifnames=0 to the kernel options
  • 5) Finally reboot.

I guess one day we may have to get used to this BSD based naming convention, But...the old way was just so much simpler! In fact, the most annoying thing is that Linux in general is gradually with every new version ceasing to be Linux with the exception for perhaps Slackware, for example it has the same curses based installation system since I first installed it many years back on a Pentium III Celeron 66/600 Copermine - when the whole system fit on a couple of 3.5 diskettes!

Anyways, if you have this issue, hope this helps and may the source be with you.

Peace be unto you. Thank you for visiting!