Ubuntu Linux view status of my network interfaces card

Wondering how to view the status of your network interface under Ubuntu Linux and make sure network connectivity exists? Here are several ways to check the status of your network interfaces(NIC)/card.

We can verify network connectivity or status of your network Interfaces/card using standard Linux commands. Open your terminal and use the following commands. You need to use the ip command or [nicmd nake=”ifconfig”] command to view the status of network interfaces card and as well as to configure a network interface itself.

Task: View network interface card

Let type the following ip command:
$ ip l show
Sample outputs:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9001 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether 0a:da:ad:83:da:95 brd ff:ff:ff:ff:ff:ff

From the above outputs, it is clear that I have two network interfaces named lo and eth0. The UP indicates that network interface is up and running. But, how do you see an IP address assigned to the network interface such as eth0? Try:
$ ip a show eth0

The above outputs indicates my eth0 has as IP address. To find out your default route on Ubuntu, run:
route -n
Sample outputs:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface         UG    100    0        0 eth0   U     0      0        0 eth0 UH    100    0        0 eth0

Another option is to run the following command:
ip r
Sample outputs:

default via dev eth0 proto dhcp src metric 100 dev eth0 proto kernel scope link src dev eth0 proto dhcp scope link src metric 100

My default gateway or router IP is set to We can use the grep command/egrep command to filter out information easily too:
ip r | grep default
ip l show | grep -A1 eth0
ip l show | egrep -A1 'eth0|lo'

Use the ifconfig on Ubuntu to get status of network iunterfaces

Older version of Ubuntu version users needs to use the ifconfig command.
$ sudo ifconfig
$ sudo /sbin/ifconfig
Sample iutputs:

eth0      Link encap:Ethernet  HWaddr 00:0F:EA:91:04:07
      inet addr:  Bcast:  Mask:
      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:  Mask:
      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:  Bcast:  Mask:
      inet6 addr: fe80::217:9aff:fe0a:f644/64 Scope:Link
      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)

According to the ifconfig command, I have total three network interface cards (NICs) on my Ubuntu server:

  • 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 which send ICMP ECHO_REQUEST to network hosts:
$ ping www.yahoo.com
$ ping www.google.com
$ ping myrouter
$ ping cyberciti.biz

Sample outputs:

PING cyberciti.biz ( 56(84) bytes of data.
64 bytes from p5w1.geo.re2.yahoo.com ( icmp_seq=0 ttl=51 time=66.5 ms
64 bytes from p5w1.geo.re2.yahoo.com ( icmp_seq=1 ttl=51 time=66.8 ms
64 bytes from p5w1.geo.re2.yahoo.com ( icmp_seq=2 ttl=51 time=67.3 ms
64 bytes from p5w1.geo.re2.yahoo.com ( icmp_seq=3 ttl=51 time=66.5 ms
64 bytes from p5w1.geo.re2.yahoo.com ( 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 the -c option (useful to write a simple monitoring shell script):
$ ping -c 3 www.cyberciti.biz

Task: Verify that network interface device is up and running

As I said eariler use the ip command and look for a flag named UP:
ip l show eth0 | grep --color -w UP
ip l show lo | grep --color -w DOWN
ip l show | grep --color -i -w DOWN

Type the following command which displays the list of device is up and running
$ sudo ifconfig -s
Sample outputs:

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.

How to print the route packets trace to network host

Use the traceroute command which tracks the route packets taken from an IP network on their way to a given host. It utilizes the IP protocol’s time to live (TTL) field and attempts to elicit an ICMP TIME_EXCEEDED response from each gateway along the path to the host. The syntax is:
traceroute www.cyberciti.biz
traceroute {ip4-address-here}
traceroute6 www.cyberciti.biz
traceroute6 {ipv6-address-here}
traceroute6 2606:4700:10::6816:bd6

Sample outputs:

traceroute to www.cyberciti.biz (, 30 hops max, 60 byte packets
 1 (  8.783 ms (  8.608 ms (  16.427 ms
 2  * (  19.649 ms (  16.416 ms
 3 (  21.954 ms (  14.668 ms (  22.047 ms
 4 (  13.820 ms (  14.816 ms (  13.780 ms
 5 (  11.944 ms (  14.482 ms (  12.290 ms
 6 (  0.661 ms (  12.948 ms (  0.524 ms
 7 (  0.300 ms (  0.558 ms (  0.396 ms
 8 (  5.622 ms  5.652 ms (  0.328 ms
 9 (  4.885 ms (  11.608 ms (  4.839 ms
10 (  0.589 ms  0.572 ms  0.684 ms

Say hello to the mtr

The mtr tool combines the functionality of the traceroute and ping programs in a single network diagnostic tool. Use the apt command/apt-get command to install mtr as follows on Ubuntu box:
sudo apt install mtr
## OR ##
sudo apt-get install mtr
Run it as follows:
mtr {IP-address}
mtr {domain-name}
mtr google.com
mtr www.cyberciti.biz


You learned various commands to find the status of network interfaces (NIC) and network connectivity on Ubuntu Linux.

🐧 Please support my work on Patreon or with a donation.
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
6 comments… add one
  • Nate Dec 4, 2016 @ 14:13

    Hello I just installed ubuntu 16.04.1 and now my wifi driver isn’t being detected it won’t even let me try to enable wifi any suggestions on how to fix it

  • Sum Yung Gai Dec 7, 2011 @ 17:28

    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”.

    • mr.mac Feb 29, 2012 @ 3:55

      i receive command not found

      • mr.mac Feb 29, 2012 @ 3:56

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

  • kalyan Nov 12, 2011 @ 16:32

    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.


  • Lars Erlandsen Mar 8, 2011 @ 10:10

    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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre> for code samples. Problem posting comment? Email me @ webmaster@cyberciti.biz