Why have my network interfaces been renamed after installing Ubuntu, and how do I rename them back?

5,127

You can rename your interfaces using udev rules.

Use ifconfig to determine your MAC addresses.

You can use ethtool --identify eth0, etc., to blink the LEDs on your interfaces to help determine the current mapping of MAC addresses to interface names.

Create a file called /etc/udev/rules.d/010_netinterfaces.rules

Add lines like these to that file, substituting your MAC addresses:

KERNEL=="eth*", SYSFS{address}=="00:12:34:fe:dc:ba", NAME="eth0"
KERNEL=="eth*", SYSFS{address}=="00:56:78:98:76:54", NAME="eth1"
KERNEL=="eth*", SYSFS{address}=="00:90:ab:32:10:fe", NAME="eth2"

You may need to edit the /etc/network/interfaces file, and change all instances of the old names to the new names.

Source

Share:
5,127

Related videos on Youtube

Ykok
Author by

Ykok

Updated on September 17, 2022

Comments

  • Ykok
    Ykok over 1 year

    I have a low power server, with 4 ethernet sockets.

    It was running Fedora 11, with 3 of the network sockets named eth0, eth1 and eth2 (the final network socket was not in use --- it was eth3 but don't know for sure that it actually worked).

    I installed Ubuntu Server 10.04 on it this morning. While it was installing, it recognised eth0 and used it to access the internet.

    Now... it doesn't. It recognises eth1 as being eth1, and claims there is an eth5 somewhere, but doesn't recognise any other interfaces from eth0-eth7.

    I require 3 working ethernet sockets.

    I would like my ethernet sockets named eth0-eth3, as they were under Fedora. How do I make that happen? Why have they been renamed in the first place?

    Ethernet sockets have always popped up with the names I was expecting before, so I don't know where to start.


    There is some inconsistency in the hardware addresses three of the ethernet ports claim to have. Sometimes they claim to be at xx:xx:xx:xx:xx:xx, at other times they claim to be at 00:00:00:00:xx:xx. (As far as I can tell, they never change hardware address when the OS is active, only when the machine is switched off, or possibly when rebooting.)

    I don't know where I go from here.


    Each ethernet port consistently has one of two hardware addresses, they're just inconsistent about which one they're using at any given time.

    I tried telling udev that both hardware addresses belong to the same ethernet port --- I expected that udev would complain at this, but it accepts it and uses the hardware address that is present for that port.

    So my problem seems to be solved.

    • mihi
      mihi over 13 years
      hmm. the inconsistent mac addresses look like a faulty driver. are the addresses consistent at least (i. e. the same device will only get say two or three different mac addresses) or do they change at every reboot? If the latter, your devices will continue to jump around since udev tries to reserve an ethX for one mac address...