Get information about your network interface with Linux.

Posted: July 22, 2014. At: 1:27 PM. This was 3 years ago. Post ID: 7558
Page permalink:

Linux has quite a few commands for finding out information about your network adapters. Below is an example. Using the ethtool command as root.

homer@deusexmachina ~ $ sudo ethtool eth2
[sudo] password for homer:
Settings for eth2:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Supported pause frame use: No
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Advertised pause frame use: No
        Advertised auto-negotiation: Yes
        Link partner advertised link modes:  10baseT/Half 10baseT/Full
                                             100baseT/Half 100baseT/Full
        Link partner advertised pause frame use: Symmetric
        Link partner advertised auto-negotiation: Yes
        Speed: 100Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 32
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: pumbg
        Wake-on: d
        Current message level: 0x00000007 (7)
                               drv probe link
        Link detected: yes

The ethtool command may also be used to get the driver information from the Ethernet adapter.

homer@deusexmachina ~ $ sudo ethtool -i eth2
driver: 8139too
version: 0.9.28
bus-info: 0000:06:02.0
supports-statistics: yes
supports-test: no
supports-eeprom-access: no
supports-register-dump: yes
supports-priv-flags: no

This command may also show the features of the Ethernet interface. Use the sudo ethtool -k eth2 command.

homer@deusexmachina ~ $ sudo ethtool -k eth2
Features for eth2:
rx-checksumming: off [fixed]
tx-checksumming: on
        tx-checksum-ipv4: off [fixed]
        tx-checksum-ip-generic: on [fixed]
        tx-checksum-ipv6: off [fixed]
        tx-checksum-fcoe-crc: off [fixed]
        tx-checksum-sctp: off [fixed]
scatter-gather: on
        tx-scatter-gather: on [fixed]
        tx-scatter-gather-fraglist: off [fixed]
tcp-segmentation-offload: off
        tx-tcp-segmentation: off [fixed]
        tx-tcp-ecn-segmentation: off [fixed]
        tx-tcp6-segmentation: off [fixed]
udp-fragmentation-offload: off [fixed]
generic-segmentation-offload: on
generic-receive-offload: on
large-receive-offload: off [fixed]
rx-vlan-offload: off [fixed]
tx-vlan-offload: off [fixed]
ntuple-filters: off [fixed]
receive-hashing: off [fixed]
highdma: on [fixed]
rx-vlan-filter: off [fixed]
vlan-challenged: off [fixed]
tx-lockless: off [fixed]
netns-local: off [fixed]
tx-gso-robust: off [fixed]
tx-fcoe-segmentation: off [fixed]
tx-gre-segmentation: off [fixed]
tx-udp_tnl-segmentation: off [fixed]
tx-mpls-segmentation: off [fixed]
fcoe-mtu: off [fixed]
tx-nocache-copy: on
loopback: off [fixed]
rx-fcs: off
rx-all: off
tx-vlan-stag-hw-insert: off [fixed]
rx-vlan-stag-hw-parse: off [fixed]
rx-vlan-stag-filter: off [fixed]

And the ifconfig command is also useful, it shows IP addressing information.

homer@deusexmachina ~ $ sudo ifconfig eth2
eth2      Link encap:Ethernet  HWaddr f8:1a:67:10:b1:63
          inet addr:  Bcast:  Mask:
          inet6 addr: fe80::fa1a:67ff:fe10:b163/64 Scope:Link
          RX packets:27539 errors:0 dropped:0 overruns:0 frame:0
          TX packets:24493 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:21266891 (20.2 MiB)  TX bytes:6593141 (6.2 MiB)

Yet another command that may be used to show all network interfaces and IP addresses is the sudo inxi -i command.

homer@deusexmachina ~ $ sudo inxi -i
Network:   Card-1: D-Link System RTL8139 Ethernet driver: 8139too
           IF: eth1 state: down mac: 00:13:46:3a:02:83
           Card-2: Realtek RTL-8139/8139C/8139C+ driver: 8139too
           IF: eth2 state: unknown speed: 100 Mbps duplex: full mac: f8:1a:67:10:b1:63
           Card-3: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller driver: r8169
           IF: eth0 state: down mac: 6c:f0:49:b5:e6:2a
           WAN IP: IF: sit0 ip: N/A IF: eth0 ip: N/A IF: eth1 ip: N/A
           IF: eth2 ip:

Finally, the ip a command will show all network interfaces on the system.

Get more information about the ip command here:

No comments have been made. Use this form to start the conversation :)

Leave a Reply