Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have been working with Debian Linux under a virtual machine (VirtualBox) and have noticed that, with the present virtual machine configuration, the EtherNet device that was configured in /etc/network/interfaces during the install was eth2 (I have generally expected eth0, eth1, etc.). I have also noticed that there don't seem to be any ethX device files in the /dev directory. This all has led me to wonder how, in a configuration where network capable devices are automatically detected, it is possible to know the names that the kernel assigns to those devices. I assume that there is something in the /proc file system but, so far, I have been unable to see anything particular.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

You can see all networking devices by running:

ifconfig -a

Another trick to debugging the ethernet drivers is to look at dmesg:

dmesg|less

You will see each driver loading and creating ethernet devices.

You mention your ethernet device changing to eth2. Did you copy or move the VM? Typically when you make a copy of a VM it will re-create the MAC address so as to not conflict with the former copy. If this happens udev will assign the "new card" another eth* device and save the previous device for the "missing" card. These rules are stored in:

/etc/udev/rules.d/

Typically in a file called ##-persistant-net.rules. You can safely remove the assignments stored in this file and reboot to have the ethernet devices reassigned.

share|improve this answer
    
I didn't copy or move the VM. I believe that I changed the settings on the ethernet adapter from NAT to host. That may have done it. –  Jon Trauntvein May 23 '11 at 22:08

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.