I have a Linux machine with two Ethernet cards both using the Intel e1000 driver. lspci reports different models of Ethernet cards, but I can't tell which is eth0 and which is eth1. Other than turning off the machine and reading the chips, how can I tell which model is eth0 and which is eth1?

link|improve this question

48% accept rate
3  
That's why I never used two of the same brand/model – OMG Ponies Nov 2 '10 at 21:32
feedback

migrated from stackoverflow.com Nov 2 '10 at 21:34

This question came from our site for professional and enthusiast programmers.

3 Answers

I haven't tried it myself, but try the ethtool command. With

ethtool -p eth0

you can get the LEDs on the card to blink. You can then easily identify which card is blinking.

link|improve this answer
Check the manpage for details: linux.die.net/man/8/ethtool – socken23 Nov 2 '10 at 21:44
feedback

Parse the output of ifconfig. It will give you the hardware MAC address that you can use to identify which card is which.

link|improve this answer
Is there a mapping somewhere from lspci output to mac address? Unfortunately, I don't have the mac addresses written down. – User1 Nov 3 '10 at 3:53
feedback

Connect only one of the interfaces to a switch then use the output of mii-diag, ethtool or mii-tool (depending on which is installed) to see which has a link. You'll then know which physical card is which interface. The output of dmesg should then help you work out which is which.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.