/ linux

Linux: Failed to start Raise network interfaces

We use a lot of virtualization technology in our stack, particularly during development. It just makes life easier. However, there are times when problems arise purely from the fact we're testing the latest tech.

Most recently, we upgraded all of our VM's to the latest Linux (Some are Debian, some are Ubuntu). Immediately, we noticed that the new machines cou;dn't connect to the nwtork... They appeared to be conected properly, they even have a DHCP allocated IP Address, but they just don't have a connection.

Turns out the network interfaces were not being initialised properly:

Failed to start Raise network interfaces
See 'systemctl status networking.service' for details

After some research, it appears that the issue is related to the Predictable-Network-Interface-Names from systemd/udev.

In order to resolve the issue, we created a new file 10-rename-network.rules in /etc/udev/rules.d/ with a rule in it to attach a specific name to the network interface matching the MAC address of the Network Interface Card (NIC):

sudo vi /etc/udev/rules.d/10-rename-network.rules


and add the following content to it:

SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="ff:ff:ff:ff:ff:ff", NAME="eth0"

where:
eth0 = desired network interface name, used in /etc/network/interfaces or /etc/network/interfaces.d/setup;
ff:ff:ff:ff:ff:ff = hardware mac address of the network device;

Additionally, you'll need to execute the following to generate a new boot/initrd image:

update-initramfs -u

and, reboot...

sudo shutdown -r now

et violla, you have yourself a connected vm.