2

I am trying to rename one of the interfaces on a cluster machine with 20 interfaces, some of them are physical, others are virtual. After researching I found out that in newer versions of Ubuntu the /etc/udev/rules.d/70-persistent-net.rules is actually missing and there isn't a way to generate it. I have tried to run: $ sudo udevadm trigger -s net -c add and /lib/udev/write_net_rules file is also missing, so there isn't an easy way to generate the /etc/udev/rules.d/70-persistent-net.rules file. I have tried to create this file, to populate it with:

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:13:f1:ab:1e:e8", ATTR{dev_id}=="0x0", ATTR{type}=="1", NAME="enp6s0f0"

I have also changed the /etc/default/grub file and added the net.ifnames=0 biosdevname=0 option to the GRUB_CMDLINE_LINUX and updated the grub: sudo update-grub but after the reboot only one of the interfaces was in my list of interfaces, the one I have renamed, so I had to remove the custom file, revert the grub settings and reboot again.

Is there a simple way to do that in Ubuntu 18.04 and what was the reason for Ubuntu to remove the /etc/udev/rules.d/70-persistent-net.rules file? but after reboot of the system the

1
  • I am not sure what you mean exactly by that @tatsu? What exactly do you want me to include? I have tried to locate the write_net_rules file and the 70-persistent-net.rules file but they are nowhere to be found. – Georgi Stoyanov Jul 15 '19 at 19:34
1

Okay, I have an answer to my question and tested it and it worked just fine on my Ubuntu. You have to create a /etc/udev/rules.d/70-persistent-net.rules file and add the following line inside:

SUBSYSTEM=="net", 
ACTION=="add", 
DRIVERS=="?*", 
ATTR{address}=="00:13:f1:ab:1e:e8", 
ATTR{dev_id}=="0x0", 
ATTR{type}=="1", 
NAME="enp6s0f0"

Where ATTR{address} contains the MAC address of the interface which name you want to change and the NAME is the name of the interface.

You also need to change the name of this interface in /etc/networ/interfaces file to match the NAME defined in /etc/udev/rules.d/70-persistent-net.rules and of course reboot the machine. After the restart, all your network interfaces will be available including the one which name you have changed.

Please note that if you modify the /etc/default/grub file and add the update the grub and modify the line:

GRUB_CMDLINE_LINUX=""

to

GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"

You will need to add all the interfaces in the /etc/udev/rules.d/70-persistent-net.rules file, otherwise only the renamed interface will show up after the restart of the machine, so I strongly advise you against changing this line. This is how I ended up with no network on my server and needed to connect locally to it to fix the network settings.

I was also not being able to find an easy way to populate the 70-persistent-net.rules file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.