How-Tos

How to Change Network Interface Name in Ubuntu (eth1 to eth0)


When last time I replaced the network card on my Ubuntu server and I couldn’t get the network to work.  Then I found ‘eth1‘ instead of ‘eth0‘ in ‘ifconfig’. But configuration was set to ‘eth0’ in ‘/etc/network/interfaces‘ file. So the solution is to rename ‘eth1’ back to ‘eth0’ as follows.

In Ubuntu edit the following file.

sudo nano  /etc/udev/rules.d/70-persistent-net.rules

and you should see something similar to this at the end of the file

SUBSYSTEM==”net”, ACTION==”add”, DRIVERS==”?*”, ATTR{address}==”00:12:3f:9f:53:48″, ATTR{dev_id}==”0x0″, ATTR{type}==”1″, KERNEL==”eth*”, NAME=”eth1

This is an auto generated config file, whenever hardware changes done with NICs will be added here. Entry for ‘eth0’ is the previous Ethernet card along with it’s hardware ID (MAC). You can delete the first configuration if we don’t need it anymore and change ‘eth1’ to ‘eth0’ from the second configuration.

Now save the file, make sure ‘/etc/network/interfaces’ file has correct configuration and reboot the machine.

Using this method we can change the interface names if we have multiple NICs according to it’s functionality. i.e LAN, WAN & DMZ.


View Comments
View Comments
There are currently no comments.