Thursday, January 14, 2010

Linux and NICs (bringing up the NIC)

Hello,
Today I will post about detection of NIC (h/w) and if a driver was installed .

Like windows, there is no central way on linux to check if something happened.

To check if NIC is present :

use lspci (list pci devices) : generally nic is connected thru pci bus (if you have one on usb, use lsusb)

ls is a general command to list things on linux, prolly ls+pci is listing pci devices and so on.

Then check if the driver was loaded:

The simplest way of do this is to grep eth lines on /var/log/dmesg file.
dmsg would prolly contain bootup messages.

cat /var/log/dmesg | grep eth

the output should be:

[xxx.xxx] eth0 : registered xyzcompany name etc.

Now simply bringup the network

For this, you need to add entries to /etc/network/interfaces file.
add:
auto eth0
iface eth0 inet dhcp

save.(you can do this via gedit, or vi or any other editor you want)
even cat > would do.
after this, use ifup -a

ifup -a

brings up all interfaces.

try pinging, traceroute and if its replying then your network is up and running!

No comments:

Post a Comment