Ubuntu Linux view the status of my network Interfaces/card

by on August 7, 2006 · 5 comments· LAST UPDATED August 8, 2006

in

Ubuntu Logo

Q. How do I view the status of my network Interface card under Ubuntu Linux ? How do I make sure connectivity exists?

A. You can verify connectivity or status of your network Interfaces/card using standard Linux command. Open your terminal and use following commands:

Ifconfig command use to view status of network Interfaces card or use to configure a network interface itself.

Task: View network interface card

$ sudo ifconfig

OR

$ sudo /sbin/ifconfig

Output:

eth0      Link encap:Ethernet  HWaddr 00:0F:EA:91:04:07
      inet addr:192.168.1.100  Bcast:192.168.1.255  Mask:255.255.255.0
      UP BROADCAST MULTICAST  MTU:1500  Metric:1
      RX packets:0 errors:0 dropped:0 overruns:0 frame:0
      TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
      Interrupt:18 Base address:0xc000
lo        Link encap:Local Loopback
      inet addr:127.0.0.1  Mask:255.0.0.0
      inet6 addr: ::1/128 Scope:Host
      UP LOOPBACK RUNNING  MTU:16436  Metric:1
      RX packets:14680 errors:0 dropped:0 overruns:0 frame:0
      TX packets:14680 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0
      RX bytes:7816123 (7.4 MiB)  TX bytes:7816123 (7.4 MiB)
ra0       Link encap:Ethernet  HWaddr 00:17:9A:0A:F6:44
      inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
      inet6 addr: fe80::217:9aff:fe0a:f644/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:41108 errors:0 dropped:0 overruns:0 frame:0
      TX packets:11462 errors:1 dropped:1 overruns:0 carrier:0
      collisions:285 txqueuelen:1000
      RX bytes:9787416 (9.3 MiB)  TX bytes:2871485 (2.7 MiB)
      Interrupt:17

I have total three network interface cards:

  • eth0 - An Ethernet network interface is a communication channel with device connected to network switch or hub. You can transfer files or use internet with eth0.
  • lo - A Lookback interface is communication channel with only one endpoint i.e. it can not be used to communicate with rest of the computer or cannot transfer files.
  • ar0 - This is my wireless communication network interface. You may see other names for your network devices, such as wlan0/ath0 etc for wireless cards.

Line that starts with ‘inet addr:’ displays actual IP address of network interface.

Task: Verify connectivity

To verify the connectivity use the ping command. It send ICMP ECHO_REQUEST to network hosts:

$ ping www.yahoo.com
$ ping www.google.com
$ ping myrouter
$ ping cyberciti.biz

Output:

PING cyberciti.biz (68.142.234.44) 56(84) bytes of data.
64 bytes from p5w1.geo.re2.yahoo.com (68.142.234.44): icmp_seq=0 ttl=51 time=66.5 ms
64 bytes from p5w1.geo.re2.yahoo.com (68.142.234.44): icmp_seq=1 ttl=51 time=66.8 ms
64 bytes from p5w1.geo.re2.yahoo.com (68.142.234.44): icmp_seq=2 ttl=51 time=67.3 ms
64 bytes from p5w1.geo.re2.yahoo.com (68.142.234.44): icmp_seq=3 ttl=51 time=66.5 ms
64 bytes from p5w1.geo.re2.yahoo.com (68.142.234.44): icmp_seq=4 ttl=51 time=66.7 ms
--- cyberciti.biz ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4005ms
rtt min/avg/max/mdev = 66.535/66.810/67.349/0.299 ms, pipe 2

If you want stop after sending 3 ECHO_REQUEST packets use -c option (useful to write a simple monitoring shell script):

$ ping -c 3 www.yahoo.com

Task: Verify that network interface device is up and running

Following command displays the list of device is up and running

$ sudo ifconfig -s

Output:

Iface   MTU Met   RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg
eth0   1500 0         0      0      0      0        0      0      0      0 BMU
lo    16436 0     16383      0      0      0    16383      0      0      0 LRU
ra0    1500 0     75498      0      0      0    13594      1      1      0 BMRU

If interface is down or not working it will not display much of above information.

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 5 comments… read them below or add one }

1 Lars Erlandsen March 8, 2011 at 10:10 am

Another good command (after you have run all the other ones) is “route -n”. It shows how the interfaces would route your packets, depending on the destination address. Good for finding default routes and special routing scenarios in your networking that you didn’t know about, which may explain why certain sites and domains cannot be seen.

Reply

2 kalyan November 12, 2011 at 4:32 pm

i am using i3, which has win7 and ubuntu , the problem is i am able to use wired network on win7 but in ubuntu i am not able to connect in the network connection tab i am not able to see any wired connection , i am new to ubuntu kindly suggest me in learning this kind of issue.

regards

Reply

3 Sum Yung Gai December 7, 2011 at 5:28 pm

There are times during troubleshooting that you want to see if you have electrical connectivity on your Ethernet interface, i. e. is the thing actually physically plugged in or not. For that, run “sudo ethtool” and look at the last line. If you’re plugged in, it’s “yes”. If not, it’s “no”.

Reply

4 mr.mac February 29, 2012 at 3:55 am

i receive command not found

Reply

5 mr.mac February 29, 2012 at 3:56 am

pls help me, i faced same problem as “kalyan” faced.

Reply

Leave a Comment

Previous post:

Next post: