Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am working with a small Linux computer that has an Ethernet interface on it.

Typically it has the lo "Local Loopback" interface on it & the eth0 "Ethernet" interface on it that does all of its Ethernet handling.

However, when I have ran the ifconfig command on it, my computer only recognized the lo interface on it and can't find its eth0 interface.

My Ethernet interface is built into the computer, so I don't think its an issue of hardware failing.

Is their some Linux command to rerecognize or scan for the Ethernet interface and try to find it?

share|improve this question

migrated from stackoverflow.com Apr 19 '12 at 20:22

This question came from our site for professional and enthusiast programmers.

1  
Did it used to work?Did you do anything kernel-related?What triggered your running ifconfig? –  byrondrossos Apr 19 '12 at 16:44
    
I believe you mean the ethernet network interface not the ethernet module . You get interfaces when you run ifconfig. –  byrondrossos Apr 19 '12 at 16:45
    
It did work previously when I had to set up the device's ip address. I don't believe I did anything kernel related. The reason I did ifconfig was to check the module when my ping command wasn't working. –  user1207381 Apr 19 '12 at 17:25
    
Could you give us the following informations: Linux kernel version (uname -a), Distribution (Ubuntu, Puppet, Fedora, Red Hat, Suse, etc.) and the distribution version, and finally (if you know) the ethernet interface manufacturer and product name (you can do 'lspci' to find this out too). It will help us to give you the right instructions as they are several ways to configure the network. –  Huygens Apr 26 '12 at 11:31
add comment

4 Answers

I believe the ifconfig command only displays active network adapters (ones that are up) unless you use the -a option as @dien illustrates.

This command always displays all of them: ip link show

Probably the interface failed to get a DHCP address from a DHCP server. Try ifup eth0, or as @ZaB suggests, dhclient eth0 -v (the -v will display diagnostic information).

If something is wrong with your DHCP and you need to set a static address temporarily, do ifconfig eth0 up {ip_address} netmask {subnet_mask} - modify /etc/resolv.conf to set your DNS servers - all this is overwritten the next time dhclient eth0 -v works.

If ip link show doesn't show an eth0 you might check in the BIOS to see if your onboard ethernet is disabled, or possibly something is wrong with the configuration of your kernel.

share|improve this answer
add comment

You can check your interface existence with

ifconfig -a 

or

ls /sys/class/net/ethX

If the device does not exist, maybe your kernel is not configured.

share|improve this answer
add comment
/etc/init.d/network start

or

dhclient eth0 

or a simple reboot?

share|improve this answer
add comment

One does not usually connect to the interface, but connect through it. For user-level stuff, /dev/ethX must to be allocated an IP address, either through DHCP (as from your router or firewall), or manually configured through the admin interface.

share|improve this answer
    
Is there anyway to add interfaces or look for them? –  user1207381 Apr 19 '12 at 17:37
    
@user1207381: Sure, for physical interfaces, you just plug them in. For virtual interfaces, you create them through the network administrative tool. –  wallyk Apr 19 '12 at 17:41
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.