Paul Kiddie

Force udev to reassign ethX identifiers in Ubuntu 8.04

November 20, 2009

Quick tip: If you have replaced your network cards in Ubuntu 8.04, or in my case imaged a Ubuntu install across many PC’s, and would like udev to redetect network cards and reassign ethX identifiers beginning with eth0, run the following command.

sudo mv /etc/udev/rules.d/70-persistent-net.rules /etc/udev/rules.d/70-persistent-net.rules.old

Then reboot the machine, and udev will recreate 70-persistent-net.rules, reassigning only the detected network adapters with an ethX identifier.

In my case the 70-persistent-net.rules file in the Ubuntu image I took contained mappings to the MAC addresses of the old imaged PC’s NIC’s. When udev detected the new NICs on boot up, it left the old rules relating to the old NICs in place, and began labelling the new NICs from the last mapped NIC (e.g. eth4). I wanted to erase the old rules, so did the above, rebooted, and udev recreated the rules file beginning from the eth0 label.

You can then further customise the ordering or naming of the NICs in Ubuntu by following this post.

👋 I'm Paul Kiddie, a software engineer working in London. I'm currently working as a Principal Engineer at trainline.