≡ Menu

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
DifficultyEasy (rss)
Root privilegesYes
RequirementsNone
Estimated completion timeN/A

  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.

lspci command

Type the following command:
# lspci | egrep -i --color 'network|ethernet'
Sample outputs:

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

lshw command

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

  *-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

ifconfig and ip command

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

/proc/net/dev

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.
$ cat /proc/net/dev
Sample outputs:

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
Tweet itFacebook itGoogle+ itPDF itFound an error/typo on this page?

{ 22 comments… add one }

  • Julian August 29, 2012, 3:28 pm

    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 August 29, 2012, 5:00 pm

    Use

    ip link show
    • Leaman Crews August 30, 2012, 12:54 am

      @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 August 30, 2012, 1:04 am

        It was a typo on part.

        ip a

        However, ip link show should be used.

  • brian t August 29, 2012, 9:41 pm

    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 August 30, 2012, 1:00 am

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

    • nixCraft August 30, 2012, 1:09 am

      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 August 30, 2012, 5:47 am

    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 August 30, 2012, 6:15 am

      @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 December 6, 2013, 9:18 pm

        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 December 7, 2013, 5:43 am

          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 September 4, 2012, 5:31 am

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

      Hope this helps!

  • Anthony August 30, 2012, 7:46 am

    @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 August 30, 2012, 8:55 pm

    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 September 2, 2012, 4:14 am

    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 September 2, 2012, 4:25 am

    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 September 2, 2012, 4:28 am

    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 September 2, 2012, 9:33 am

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

  • Augustin October 7, 2013, 9:59 am

    how to check the nic card settings in linux

    • Aram Iskenderian October 10, 2013, 7:09 am

      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 September 17, 2014, 9:02 am

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

  • sunardy October 28, 2014, 8:32 am

    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

Leave a Comment