What's the difference between `en0` and `eth0`?

6,897

I see your edit, but the comment is correct... It is the same mechanism referenced.

It's the concept of biosdevnames / consistent device naming.

In RHEL6/CentOS 6 there was an attempt to work around this via a special udev rule:

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

Within that file you will see a mapping (by mac address) attempting to provide consistent names, but not in the way mentioned in the consistent device naming article linked above.

The most common case I experienced this was when users would clone a VM. This would change the mac address of the VM and then that UDEV rule would present the new mac address as a new device, effectively locking the old device in as eth0.

To determine the file you should use, check the name mapped in /etc/udev/rules.d/70-persistent-net.rules by the mac address of the VMs network adapter. Using that file, you can map it to anything you like. Once you know the name, use the corresponding file in /etc/sysconfig/network-scripts.

After UDEV rule changes, reload them with:

sudo udevadm control -R

After that you can manually trigger processing of the rules with:

sudo udevadm trigger

In the long run you should clear any unwanted rules from /etc/udev/rules.d/70-persistent-net.rules.

Share:
6,897

Related videos on Youtube

fanhualuojin154873
Author by

fanhualuojin154873

Updated on September 18, 2022

Comments

  • fanhualuojin154873
    fanhualuojin154873 over 1 year

    What's the difference between en0 and eth0?

    In my CentOS 6 VM, there is list of network-scripts:

    [root@localhost /]# ls /etc/sysconfig/network-scripts/
    ifcfg-en0    ifdown-ipv6    ifup          ifup-plip    ifup-wireless
    ifcfg-eth0   ifdown-isdn    ifup-aliases  ifup-plusb   init.ipv6-global
    ifcfg-lo     ifdown-post    ifup-bnep     ifup-post    net.hotplug
    ifdown       ifdown-ppp     ifup-eth      ifup-ppp     network-functions
    ifdown-bnep  ifdown-routes  ifup-ippp     ifup-routes  network-functions-ipv6
    ifdown-eth   ifdown-sit     ifup-ipv6     ifup-sit
    ifdown-ippp  ifdown-tunnel  ifup-isdn     ifup-tunnel
    

    you see there are ifcfg-en0 and ifcfg-eth0, does it have any difference between them? the ifcfg-eth0 I have used(configured data in it), now I want to add a more IP address, which file I can configured?


    EDIT-01

    The enoX and the ethX is not related to my post, mine is enX.

    • Admin
      Admin over 5 years
    • muru
      muru over 5 years
      Check the output of ifconfig -a or ip link show to see which interface name you have and use it.
    • telcoM
      telcoM over 5 years
      ethtool -i en0 and ethtool -i eth0 might provide useful information too (the PCI device ID and the name of the driver responsible for the NIC).
  • fanhualuojin154873
    fanhualuojin154873 over 5 years
    do you mean, there is no other difference except the interface name?
  • Prabhin
    Prabhin over 5 years