2

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?

4
  • 1
    Did it used to work?Did you do anything kernel-related?What triggered your running ifconfig?
    – byrondrossos
    Apr 19, 2012 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, 2012 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, 2012 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, 2012 at 11:31

4 Answers 4

2

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.

0

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.

2
  • Is there anyway to add interfaces or look for them?
    – user1207381
    Apr 19, 2012 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, 2012 at 17:41
0
/etc/init.d/network start

or

dhclient eth0 

or a simple reboot?

0

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.

You must log in to answer this question.

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