How to check which network card is in use Linux

I have multiple network card in my Linux box. How do you check which network card is in use Linux currently?

To list network cards run

ip -br link show
# eth0
ip -br link show eth0
# Wifi
ip -br link show wifi0

Look for UP state.

To see active link mode, speed, duplex and link status

sudo ethtool eth0
sudo ethtool enp0s31f6 
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

How to know which network Adapter using in Linux

Run

sudo lshw -C network
sudo lshw -C network -short

You will see info:

H/W path               Device          Class          Description
\=================================================================
/0/100/1d.6/0          wlp82s0         network        Wi-Fi 6 AX200
/0/100/1f.6            enp0s31f6       network        Ethernet Connection (7) I219-LM
/2                     vethb05203e8    network        Ethernet interface
/3                     veth86b7621e    network        Ethernet interface
/4                     virbr0-nic      network        Ethernet interface
/5                     veth239cdd48    network        Ethernet interface
/6                     vethde2ee379    network        Ethernet interface
/7                     veth75b414d1    network        Ethernet interface

See my tutorials:

And:

1 Like

Linux sysadmin blog - Linux/Unix Howtos and Tutorials - Linux bash shell scripting wiki