How to list all physically installed Network Cards (Debian)?
My "Dedicated Server" should have two NICs installed but I can only find one.
My Question: What other commands and methods are available to test how many network cards are installed on my server
lspci | grep Ethernet
Are there any other commands / methods available?
Solution 1:
You can use lshw to see all devices on a machine. To view just the network devices enter:
lshw -class network
Solution 2:
ip link show
will list everything that looks like a network interface.
Solution 3:
find /sys/class/net -type l -not -lname '*virtual*' -printf '%f\n'
Shows just interfaces that relate to a physical NIC.
Tried to find a type
option to ip link show
that would display non-logical, but alas:
ip link help 2>&1 | grep -A10 'TYPE :='
TYPE := { vlan | veth | vcan | dummy | ifb | macvlan | macvtap |
bridge | bond | ipoib | ip6tnl | ipip | sit | vxlan |
gre | gretap | ip6gre | ip6gretap | vti | nlmon |
bond_slave | ipvlan | geneve | bridge_slave | vrf }
It seems to be the one thing that ip link show
cannot do. At least not without resorting to a script that first lists each of the above and then does grep -v
against a final run without type
specified.