Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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!

share|improve this question
add comment

1 Answer

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).

share|improve this answer
    
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 –  Lily Chavez Oct 25 '12 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 Oct 25 '12 at 0:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.