HowTo: Linux Show List Of Network Cards

How do I display a list of all network cards under Linux operating systems?

You can use any one of the following command to list network cards installed under Linux operating systems. Please note that the ifconfig and ip commands will also display interfaces information about vpn, loopback, and other configured interfaces.
Tutorial details
Difficulty level Easy
Root privileges Yes
Requirements Linux
Est. reading time 2m
  1. lspci command : List all PCI devices.
  2. lshw command : List all hardware.
  3. dmidecode command : List all hardware data from BIOS.
  4. ifconfig command : Outdated network config utility.
  5. ip command : Recommended new network config utility.
  6. hwinfo command : Probe Linux for network cards.
  7. ethtool command : See NIC/card driver and settings on Linux.

We use standard terms, such as the network interface controller (NIC). Also known as a network interface card, network adapter, LAN adapter or physical network interface, and so on. Let us see some useful examples for displing out NIC info on Linux.

Use lspci command Linux command to show list of network cards

Type the following lspci command along with egrep command to filter out devices:
# lspci | egrep -i --color 'network|ethernet'
# lspci | egrep -i --color 'network|ethernet|wireless|wi-fi'

Sample outputs from my Linux server:

09:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5761e Gigabit Ethernet PCIe (rev 10)
0c:00.0 Network controller: Intel Corporation Ultimate N WiFi Link 5300

How to use lshw command for displaying network cards (NIC) on Linux

The lshw command can extract detailed information on the hardware configuration of the machine including network cards. Type the following command:
# lshw -class network
Detailed hardware information about network cards on Linux:

  *-network DISABLED      
       description: Wireless interface
       product: Ultimate N WiFi Link 5300
       vendor: Intel Corporation
       physical id: 0
       bus info: pci@0000:0c:00.0
       logical name: wlan0
       version: 00
       serial: 00:21:6a:ca:9b:10
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=iwlwifi driverversion=3.2.0-0.bpo.1-amd64 firmware=8.83.5.1 build 33692 latency=0 link=no multicast=yes wireless=IEEE 802.11abgn
       resources: irq:46 memory:f1ffe000-f1ffffff
  *-network
       description: Ethernet interface
       product: NetXtreme BCM5761e Gigabit Ethernet PCIe
       vendor: Broadcom Corporation
       physical id: 0
       bus info: pci@0000:09:00.0
       logical name: eth0
       version: 10
       serial: b8:ac:6f:65:31:e5
       size: 1GB/s
       capacity: 1GB/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm vpd msi pciexpress bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=tg3 driverversion=3.121 duplex=full firmware=5761e-v3.71 ip=192.168.1.5 latency=0 link=yes multicast=yes port=twisted pair speed=1GB/s
       resources: irq:48 memory:f1be0000-f1beffff memory:f1bf0000-f1bfffff

Here is another outputs:

$ sudo lshw -class network -short
H/W path           Device        Class          Description
===========================================================
/0/100/1d.6/0      wlp82s0       network        Wi-Fi 6 AX200
/0/100/1f.6        eth0          network        Ethernet Connection (7) I219-LM

Where,

  1. -class network : View all network cards on your Linux system
  2. -short : Display device tree showing hardware paths, very much like the output of HP-UX’s ioscan

Let us see mask, IP and other information set up for wlp82s0:
$ ip a show wlp82s0

Linux ethtool command for Ethernet hardware devices

Want to see/query or control network driver and hardware settings on Linux? Try the the ethtool command:
$ sudo ethtool enp0s31f6
And it spitted out tons of useful information for my Ethernet network card on Linux:

Settings for enp0s31f6:
	Supported ports: [ TP ]
	Supported link modes:   10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Full 
	Supported pause frame use: No
	Supports auto-negotiation: Yes
	Supported FEC modes: Not reported
	Advertised link modes:  10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Full 
	Advertised pause frame use: No
	Advertised auto-negotiation: Yes
	Advertised FEC modes: Not reported
	Speed: 1000Mb/s
	Duplex: Full
	Port: Twisted Pair
	PHYAD: 1
	Transceiver: internal
	Auto-negotiation: on
	MDI-X: off (auto)
	Supports Wake-on: pumbg
	Wake-on: g
	Current message level: 0x00000007 (7)
			       drv probe link
	Link detected: yes

We can display driver information for network card too:
$ sudo ethtool -i eth0
$ sudo ethtool -i enp0s31f6

ifconfig and ip commands

To see all configured network devices, enter:
# ifconfig -a
OR
# ip link show
OR
# ip a
Sample outputs:

1: lo:  mtu 16436 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0:  mtu 1500 qdisc mq state UP qlen 1000
    link/ether b8:ac:6f:65:31:e5 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.5/24 brd 192.168.1.255 scope global eth0
    inet6 fe80::baac:6fff:fe65:31e5/64 scope link 
       valid_lft forever preferred_lft forever
3: wlan0:  mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether 00:21:6a:ca:9b:10 brd ff:ff:ff:ff:ff:ff
4: pan0:  mtu 1500 qdisc noop state DOWN 
    link/ether 92:0a:e7:31:e0:83 brd ff:ff:ff:ff:ff:ff
5: vmnet1:  mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
    link/ether 00:50:56:c0:00:01 brd ff:ff:ff:ff:ff:ff
    inet 192.168.121.1/24 brd 192.168.121.255 scope global vmnet1
    inet6 fe80::250:56ff:fec0:1/64 scope link 
       valid_lft forever preferred_lft forever
6: vmnet8:  mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
    link/ether 00:50:56:c0:00:08 brd ff:ff:ff:ff:ff:ff
    inet 192.168.179.1/24 brd 192.168.179.255 scope global vmnet8
    inet6 fe80::250:56ff:fec0:8/64 scope link 
       valid_lft forever preferred_lft forever

Want to list all IP addresses and interfaces on Linux in a tabular format for better readability? Try:
$ ip -br -c link show
$ ip -br -c addr show

Listing network cards on Linux using hwinfo command

Open the terminal and then type:
$ sudo hwinfo --network --short

network interface:                                              
  veth4cf4e314         Ethernet network interface
  lxdbr0               Ethernet network interface
  veth5ac9105a         Ethernet network interface
  veth0932715b         Ethernet network interface
  veth514990e6         Ethernet network interface
  lo                   Loopback network interface
  eth0                 Ethernet network interface
  veth844c4162         Ethernet network interface
  vethe8d69a5f         Ethernet network interface

We can now obtain more info for eth0 using the ip command:
$ ip a s eth0
My IP address assigned to eth0:

2: eth0:  mtu 9001 qdisc mq state UP group default qlen 1000
    link/ether 0a:99:85:fc:11:57 brd ff:ff:ff:ff:ff:ff
    inet 172.26.9.151/20 brd 172.26.15.255 scope global dynamic eth0
       valid_lft 3501sec preferred_lft 3501sec
    inet6 fe80::899:85ff:fefc:1157/64 scope link 
       valid_lft forever preferred_lft forever

The /proc/net/dev file

The dev pseudo-file contains network device status information. This gives the number of received and sent packets, the number of errors and collisions and other basic statistics. Open the terminal and then type the following cat command:
$ cat /proc/net/dev
Stats:

Inter-|   Receive                                                |  Transmit
 face |bytes    packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carrier compressed
    lo:   20097     179    0    0    0     0          0         0    20097     179    0    0    0     0       0          0
vmnet8:       0       0    0    0    0     0          0         0        0      33    0    0    0     0       0          0
  pan0:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
 wlan0:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
  eth0: 592509534  623058    0    0    0     0          0      1053 122269656  401567    0    0    0     0       0          0
vmnet1:       0       0    0    0    0     0          0         0        0      34    0    0    0     0       0          0

Conclusion

We learned about various Linux commands to display information about installed and running network cards.


🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 23 comments so far... add one


CategoryList of Unix and Linux commands
Disk space analyzersdf duf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Modern utilitiesbat exa
Network UtilitiesNetHogs dig 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 glances gtop jobs killall kill pidof pstree pwdx time vtop
Searchingag grep 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
23 comments… add one
  • Julian Aug 29, 2012 @ 15:28

    In which distro are you using the ip command? I’m trying it in Ubuntu and it seems to be a command to manipulate routing

  • Chex Aug 29, 2012 @ 17:00

    Use

    ip link show
    • Leaman Crews Aug 30, 2012 @ 0:54

      @Chex, thanks! On Ubuntu, I was getting an error trying to run ‘ip -a’, but your command worked — and it’s very useful info.

      • 🐧 nixCraft Aug 30, 2012 @ 1:04

        It was a typo on part.

        ip a

        However, ip link show should be used.

  • brian t Aug 29, 2012 @ 21:41

    For wireless cards I find “iwconfig” useful. I used to have problems with a wireless adapter going offline, which I worked around with “iwconfig wlan0 power off” to turn off its power management feature.

  • dude Aug 30, 2012 @ 1:00

    It would be most useful to correlate the HW info to the logical device name, such as the Broadcom NIC is eth1.

    • 🐧 nixCraft Aug 30, 2012 @ 1:09

      Try ethtool or lspci it will map both along with driver name:

      ethtool -i eth0
      ethtool -i wlan0

      OR

      lspci -v -s deviceID

      Writing a shell script left as an exercise for the reader.

  • root Aug 30, 2012 @ 5:47

    At any point is this site going to post anything that isn’t basic common knowledge to any linux users that isnt a complete noob?

    Because if not, then I’m going to unsubscribe from your RSS feed.

    • 🐧 nixCraft Aug 30, 2012 @ 6:15

      @root,

      I can not stop you or anyone else from unsubscribing to our RSS feed. The /faq/ section is for new users only so it has all sort of questions and answers. As you may have noticed that I’ve already started to display the difficulty level for each Q & A. I’m also working on rss feed for all three difficulties. So that users can only subscribe as follows:

      • Easy – for beginners.
      • Moderate – for Intermediate users.
      • Hard – for Advanced users.

      This is going to take a little more time as need some sort of coding and modification on my part. Hope this helps.

      • lolcat Dec 6, 2013 @ 21:18

        ok, so idioms for the easy/intermediate/hard would be ubuntu/debian/all others? ^^

        Nah, but linux is no longer for those who actually are bothered to learn how to use a computer (as opposed to the in ‘noob-land’), learn how to use windows. Now, many of the windows users who are just ‘end users’ and not computer savvy, migrate to linux, and will inadvertedly land on ubuntu like distros.

        I recall on youtube, some user saying, I have been using Ubuntu for 6 months and consider myself fairly knowledgable, and then went on about DE if they are installable in other distros and what not. I don’t even know what it was, but it was so absurd, I am glad that person uttered Ubuntu and not linux, as clearly the person was clueless in the latter.

        • BobTheCat Dec 7, 2013 @ 5:43

          You can blame Canonical for such issue. Just visit http://www.ubuntu.com/desktop home page and try to find out word Linux. I think they are ashamed of using word Linux.

          PS: I use Debian Linux :)

    • 🐧 nixCraft Sep 4, 2012 @ 5:31

      [updated] Various aspects of nixCraft can be monitored with RSS feeds including ability to sort out feed – https://www.cyberciti.biz/nixcraft-rss-feed-syndication/

      Hope this helps!

  • Anthony Aug 30, 2012 @ 7:46

    @root
    I don’t suppose you have noticed that at least 99% of the worlds population are at least some variant of a linux ‘noob’. It would indeed be pointless to run a web site for just the 1% who are whizz kids as you would have very few visitors indeed.

    Also, I believe it should be ‘to any linux user who isn’t’

    Regards.

  • Anthony Aug 30, 2012 @ 20:55

    I’ve clearly lost the plot a little myself, ‘at least’ and ‘indeed’ twice in above comment. Have to stop taking these tablets.

  • Aram Iskenderiann Sep 2, 2012 @ 4:14

    In your scripts, the easiest way is to do something like this.

    for x in `/sbin/ifconfig | grep Link | awk ‘{print $1}’ | sort | egrep -v ‘inet6|lo’`
    do
    echo $x
    done

    Or you can /sbin/ifconfig $x | grep to extract and read the data into a variable to work on later.

  • Aram Iskenderian Sep 2, 2012 @ 4:25

    Here is a small code you can use in your scripts.

    for x in `/sbin/ifconfig | grep Link | awk ‘{print $1}’ | sort | egrep -v ‘inet6|lo’`
    do
    echo $x
    done

    You can replace echo $x with
    /sbin/ifconfig $x | grep (any property you are looking for) and read that into a variable.

  • Aram Iskenderian Sep 2, 2012 @ 4:28

    I think some of the posts are not being accepted in the comments, Vivek. Not sure why. I thought first it was something in my browser.
    I sure hope I didn’t have duplicates in the comments. :-)

    • 🐧 nixCraft Sep 2, 2012 @ 9:33

      We cache page for 15 minutes. So you will not see updates immediately.

  • Augustin Oct 7, 2013 @ 9:59

    how to check the nic card settings in linux

    • Aram Iskenderian Oct 10, 2013 @ 7:09

      What distro?
      What specifics you are looking for?
      If you mean network settings for each card, depending on your distro, it can be found at

      For Redhat based distros
      /etc/sysconfig/network-scripts/ifcfg-[device Name]

      For Debian based distros
      /etc/network/interfaces

      For in depth, in detail information other settings about your network card, use ethtool.

      Run
      man ethtool

  • cabdiqani Sep 17, 2014 @ 9:02

    i have dell and i have wireless in my neighbours but shows me red cross so what i do please

  • sunardy Oct 28, 2014 @ 8:32

    hi all,

    I am new in linux.
    now I have problem with my X-Server installation.

    my machine used Red Hat V7,2
    and my card is used AGX3281.

    this is I did for replaced the old card, but I did with the same type.

    after I finished the install the X-server, and run startx,
    [root@barco1 root]# startx

    xinit: No such file or directory (errno 2): no server “X” in PATH

    Use the — option, or make sure that /usr/X11R6/bin is in your path and
    that “X” is a program or a link to the right type of server
    for your display. Possible server names include:

    XFree86 XFree86 displays

    giving up.
    xinit: Connection refused (errno 111): unable to connect to X server
    xinit: No such process (errno 3): Server error.

    and when I start lspci
    [root@barco1 root]# lspci
    00:00.0 Host bridge: Intel Corp.: Unknown device 2770 (rev 02)
    00:02.0 Display controller: Intel Corp.: Unknown device 2772 (rev 02)
    00:1c.0 PCI bridge: Intel Corp.: Unknown device 27d0 (rev 01)
    00:1c.1 PCI bridge: Intel Corp.: Unknown device 27d2 (rev 01)
    00:1c.2 PCI bridge: Intel Corp.: Unknown device 27d4 (rev 01)
    00:1c.3 PCI bridge: Intel Corp.: Unknown device 27d6 (rev 01)
    00:1d.0 USB Controller: Intel Corp.: Unknown device 27c8 (rev 01)
    00:1d.1 USB Controller: Intel Corp.: Unknown device 27c9 (rev 01)
    00:1d.2 USB Controller: Intel Corp.: Unknown device 27ca (rev 01)
    00:1d.3 USB Controller: Intel Corp.: Unknown device 27cb (rev 01)
    00:1d.7 USB Controller: Intel Corp.: Unknown device 27cc (rev 01)
    00:1e.0 PCI bridge: Intel Corp. 82801BAM PCI (rev e1)
    00:1f.0 ISA bridge: Intel Corp.: Unknown device 27b8 (rev 01)
    00:1f.2 IDE interface: Intel Corp.: Unknown device 27c0 (rev 01)
    00:1f.3 SMBus: Intel Corp.: Unknown device 27da (rev 01)
    0b:05.0 PCI bridge: Intel Corp.: Unknown device b154
    0b:0b.0 Ethernet controller: Intel Corp. 82541PI Gigabit Ethernet Controller (re
    v 05)
    0c:00.0 VGA compatible controller: ATI Technologies Inc: Unknown device 4c57
    0c:01.0 VGA compatible controller: ATI Technologies Inc: Unknown device 4c57
    0c:02.0 VGA compatible controller: ATI Technologies Inc: Unknown device 4c57
    0c:03.0 VGA compatible controller: ATI Technologies Inc: Unknown device 4c57
    0c:04.0 Host bridge: NEC Corporation Vrc5074 [Nile 4] (rev 03)

    I really need your advice for this issue.

    thanks before.

    best regards,

    Sunardy

  • prit Nov 30, 2017 @ 21:24

    Thank you.. Much Appreciated

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum