Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Troubleshooting Ethernet Adapters on Ubuntu

Troubleshooting Ethernet on Ubuntu

Here are some commands to help troubleshoot network card issues on Ubuntu:

Find Connection State

Determine Speed and Duplex

dmesg |grep eth0

lshw -c network

Most useful

Command:

sudo lshw -c network

Displays details of all network adapters in your system including the identity used for configuring the adapter (e.g. eth0, enp2s0, etc.)

  *-network               
       description: Ethernet interface
       product: 82572EI Gigabit Ethernet Controller (Copper)
       vendor: Intel Corporation
       physical id: 0
       bus info: pci@0000:04:00.0
       logical name: enp2s0
       version: 06
       serial: 00:0A:0A:0A:0A:0A
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 32 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list rom ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=e1000e driverversion=3.2.6-k duplex=full firmware=5.11-10 latency=0 link=yes multicast=yes port=twisted pair speed=1Gbit/s
       resources: irq:01 memory:00000000-ffffffff memory:00000000-ffffffff ioport:dc00(size=32) memory:00000000-ffffffff

ip addr

Less useful

Command:

sudo ip addr

This command will display output from your network adapters.

2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:0A:0A:0A:0A:0A brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.5/24 brd 192.168.1.255 scope global enp5s2
       valid_lft forever preferred_lft forever
    inet6 fe80::000:0000:0000:0000/64 scope link 
       valid_lft forever preferred_lft forever

ip addr flush dev

Command:

sudo ip addr flush dev eth0

For those times when a network adapter's configuration may be cached and you need to clear it in order to use ifup

lspci | egrep -i --color 'network|ethernet'

Command

lspci | egrep -i --color 'network|ethernet'

Displays details about the network adapters in your system

04:00.0 Ethernet controller: Intel Corporation 82572EI Gigabit Ethernet Controller (Copper) (rev 06)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.