So this has been driving me nuts for a good couple of hours, so I thought I'd ask about it here (let me know if there's a better forum for this question).

I have a CentOS Virtual Machine on ESXi. I was trying to configure the network interface because it wasn't working, so I changed the file /etc/sysconfig/network-scripts/ifcfg-eth0 to the right IP address/gateway/netmask/MAC ID etc. After restarting the network this has fixed my connection problem (I can ping the default gateway and other VMs). However, when I type "ifconfig" I don't get the listing of "eth0" as an interface, but I get "eth2" and "eth3"instead, even though the files /etc/sysconfig/network-scripts/ifcfg-eth and /etc/sysconfig/network-scripts/ifcfg-eth3 do not exist.

This makes me think that "ifconfig" gets its interface list from somewhere else, and I'm not really clear on how it does this. I tried editing /etc/udev/rules.d/70-persistent-net.rules to see if deleting the entries for eth2 and eth3 would fix this, but it doesn't.

So if anyone knows why I'm getting this behavior for ifconfig, let me know. Thanks!

1 Answer 1


Start by doing ifconfig -a to show all interfaces and make sure that eth0 even is there. I find it quite peculiar that eth2 and eth3 are created when they don't have ifcfg- files.

Try renaming /etc/udev/rules.d/70-persistent-net.rules to something else (backup) and then run /lib/udev/write_net_rules as root and then check the file's output. Before running the script set UDEV_LOG = 7 so you can get all the debug output.

Edit 0

Also run ip link to see what interfaces the ip utility sees (this is the tool that is used to set interface names).

  • doing ifconfig -a doesn't show eth0 output, just eth2 eth3 and lo. Running /lib/udev/write_net_rules has output of missing $INTERFACE running ip link results in: 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000 link/ether 00:50:56:ab:34:b7 brd ff:ff:ff:ff:ff:ff 3: eth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:50:56:ab:34:b6 brd ff:ff:ff:ff:ff:ff Commented Oct 25, 2012 at 0:02
  • The only other thing I suggest to try (if you have "KVM" access to the VM) is to shutdown the networking. Make sure that there is only /etc/sysconfig/ifcfg-eth0 (to make sure the others weren't created after shutting down the network). If ifcfg-eth0 isn't there, create it with the proper information and then start up the networking again. It's also odd that eth1 isn't there either. Have you completely rebooted the VM?
    – sparticvs
    Commented Oct 25, 2012 at 0:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .