Change ethX index
Solution 1:
The interface names are assigned by udev
dynamically or according to the rules declared in the file /etc/udev/rules.d/70-persistent-net.rules
. Although udev
manages devices dynamically, putting the rules in this file make udev
to take persistent decisions about the interfaces defined here.
So to change the name of an interface, open the file /etc/udev/rules.d/70-persistent-net.rules
, find the appropriate interface first by checking the MAC address e.g. ATTR{address}=="00:1a:XX:YY:c9:ZZ"
. After finding the interface you want to change the name, replace the name e.g. NAME="eth3"
at last of the line with the name you want e.g. NAME="eth0"
So the line becomes :
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1a:XX:YY:c9:ZZ", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
Also do the same for other interface rules too if you want to change their names too. After doing the renaming restart the computer and the interfaces should be renamed properly.
Also note that as you have interfaces defined already with names eth0
and eth1
, disable those rules by deleting or commenting out the lines containing the rules first, otherwise there will be a conflict and renaming won't be done.
Solution 2:
I am attempting to answer only one part : "Where does eth3 & eth4 came from ?. Going by one of my experience, the mac addresses pointing to the names eth0,eth1, eth2 would have been become redundant by a mother board/network card replacement in the machine. So if this caused by a network interface going away from the machine, you can safely delete them.