Polls

Topics

Linux Identifying ~ Which NIC Is Which - Which NIC is eth0?

Posted by Vivek on Thursday January 17, 08 @1:05 pm

From my mailbag the other day I received an interesting question about network interface:

I've 4 network card installed in my server and I need to find out which NIC is which? How do I tell which physical card is eth0 and which one is eth1 and so on using command line options? If my server is 5000 miles away, how do I tell which NIC is eth0 w/o interrupting network traffic?

I've got some thoughts on this myself such as:
[a] use ping command - Easy to use

[b] udev persistent-net rules - See /etc/udev/rules.d/*persistent-net.rules

[c] ethtool -p eth0 5 - It will initiates adapter-specific action intended to enable an operator to easily identify the adapter by sight. Typically this involves blinking one or more LEDs on the specific ethernet port. But, it will not work with all drivers

Anyway, I thought that it would be interesting to throw this to you the reader to comment on.

Want to stay up to date with the latest Linux tips, news and announcements? Subscribe to our free e-mail newsletter or full RSS feed to get all updates. You can Email this page to a friend.

You may also be interested in...

Discussion on This Article:

  1. Reo Strong Says:

    The only way that I’ve found is using ifup and ifdown and just unplugging the cables to see which one works/fails under the right circumstances.

    If you know the MAC addresses, you can simply do it with ifconfig. Unfortunately, I’ve never thought far enough ahead to annotate the MACs when I’m building the server.

  2. xiao_haozi Says:

    Well off the top head, if you have physical access and can afford to have it offline for a few moments, you could use ifconfig and list all of the interfaces, take them all down, and one by one turn them on and ping and see which card’s transfer light flashes. Crude, I know.

  3. mastrboy Says:

    by my experience, if you know which the physical NIC is, then it’s easy to identify in linux (atleast in a tower cabinet)

    Let me elaborate with a picture:
    http://img178.imageshack.us/my.php?image=prtmb9bnt7.jpg

    though this may not always be the case…

  4. tomdeb Says:

    I use tcpdump on each interface to see which one sees any broadcast or arp requests.

  5. vivek Says:

    @Reo, we need to find out w/o interrupting network traffic

    @tomdeb, good suggestion

    Appreciate all of your posts.

  6. Bob Weber Says:

    masterboy,

    Don’t think that always works. I’ve noticed eth assignments will change with different kernel builds. For example, my recent upgrade from Slackware 10.2 to Slackware 12 resulted in my eth numbers being re-assigned, I had to change my iptables configurations to get everything working again.

    I’ve never understood why this is, if anyone has an explaination I would be interested to hear it.

  7. vivek Says:

    Bob,

    Look at udev configuration file. I’ve also documented my RHEL / CentOS experience here

    HTH

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

~ Last updated on: January 17, 2008

Copyright © 2004-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.