I want to use my computer as a router. So I checked how many ethernet card I have running : lspci | grep -i net
. I got a single line ? Does it mean that I have only one "eth0" ethernet card ?
I want to use my computer as a router. So I checked how many ethernet card I have running : lspci | grep -i net
. I got a single line ? Does it mean that I have only one "eth0" ethernet card ?
Yes, but more than 1 line does not mean more than 1 NIC. Example
This is 1 NIC connected to eth0:0 and eth0:1 (so 2 IP adresses) that is a PCI device(!).
There is a better command:
2 NICs both with more than 1 connection. "eth1" is a USB device though so not shown in the 1st command.
--- from comments
ip link
is even better:lspci
list alll PCI devices so if you have some old built in network card, or some usb cards it will not shown in the result, so to get more precise result try this:Thanks for @gertvdijk note add the
-a
option to ifconfig to list all interfaces even if they are down