Networking Forums

Networking Forums > Computer Networking > Linux Networking > determining which card is which ethX interface

Reply
Thread Tools Display Modes

determining which card is which ethX interface

 
 
spip_yeah@yahoo.com
Guest
Posts: n/a

 
      11-07-2006, 11:44 PM
Hello,

How can I go about determining which card is assigned which name if I
have more than one?

At the moment, I have two NICs in a PC. Running ifconfig reveals the
interface names along with the MAC addresses. Running lspci reveals the
hardware information. But I don't know which NIC model got assigned
what interface name.

Many thanks.
Spip.

 
Reply With Quote
 
 
 
 
Bit Twister
Guest
Posts: n/a

 
      11-07-2006, 11:49 PM
On 7 Nov 2006 16:44:36 -0800, (E-Mail Removed) wrote:
> Hello,
>
> How can I go about determining which card is assigned which name if I
> have more than one?
>
> At the moment, I have two NICs in a PC. Running ifconfig reveals the
> interface names along with the MAC addresses. Running lspci reveals the
> hardware information. But I don't know which NIC model got assigned
> what interface name.


mii-tool -v

unplug one ethernet cable

mii-tool -v
 
Reply With Quote
 
spip_yeah@yahoo.com
Guest
Posts: n/a

 
      11-08-2006, 01:28 AM

Bit Twister wrote:
> mii-tool -v
>
> unplug one ethernet cable
>
> mii-tool -v



Thanks, that works.

However, how would you do it without human intervention?

 
Reply With Quote
 
Bit Twister
Guest
Posts: n/a

 
      11-08-2006, 01:31 AM
On 7 Nov 2006 18:28:19 -0800, (E-Mail Removed) wrote:

> However, how would you do it without human intervention?


Bitch, bitch, bitch, :-)

shutdown one nic,
ifconfig
 
Reply With Quote
 
Allen McIntosh
Guest
Posts: n/a

 
      11-08-2006, 03:12 AM
Bit Twister wrote:
> On 7 Nov 2006 18:28:19 -0800, (E-Mail Removed) wrote:
>> However, how would you do it without human intervention?

> shutdown one nic,
> ifconfig


If NICs are from different manufacturers (this wasn't clear in the OP),
then ifconfig + look MAC addresses up in a table of manufacturers.
/usr/share/ethereal/manuf (or wireshark equivalent) is a good place.
 
Reply With Quote
 
Bit Twister
Guest
Posts: n/a

 
      11-08-2006, 03:24 AM
On Tue, 07 Nov 2006 23:12:44 -0500, Allen McIntosh wrote:
> Bit Twister wrote:
>> On 7 Nov 2006 18:28:19 -0800, (E-Mail Removed) wrote:
>>> However, how would you do it without human intervention?

>> shutdown one nic,
>> ifconfig

>
> If NICs are from different manufacturers (this wasn't clear in the OP),
> then ifconfig + look MAC addresses up in a table of manufacturers.
> /usr/share/ethereal/manuf (or wireshark equivalent) is a good place.



Usually first nic on the I/O buss is labeled eth0 assuming no one played
games in /etc/modprobe.conf or /etc/modules.conf

Then again just use lshw if available for your distribution.

 
Reply With Quote
 
Joe Pfeiffer
Guest
Posts: n/a

 
      11-08-2006, 04:26 AM
(E-Mail Removed) writes:

> Hello,
>
> How can I go about determining which card is assigned which name if I
> have more than one?
>
> At the moment, I have two NICs in a PC. Running ifconfig reveals the
> interface names along with the MAC addresses. Running lspci reveals the
> hardware information. But I don't know which NIC model got assigned
> what interface name.


Name 'em yourself! Google for ifrename. It lets you make a
determination based on just about anything you want, and assign pretty
much any name you want based on it.

I've used this on a couple of machines that have multiple NICs for
different reasons: my laptop's interfaces are now named "wired" and
"wireless"; my router's interfaces are "inside" and "outside". In
both cases (and according to the docs, the vast majority of cases), I
used the MAC addresses to determine which was what and give them
useful names.
--
Joseph J. Pfeiffer, Jr., Ph.D. Phone -- (505) 646-1605
Department of Computer Science FAX -- (505) 646-1002
New Mexico State University http://www.cs.nmsu.edu/~pfeiffer
 
Reply With Quote
 
spip_yeah@yahoo.com
Guest
Posts: n/a

 
      11-08-2006, 08:17 AM
> Name 'em yourself! Google for ifrename. It lets you make a
> determination based on just about anything you want, and assign pretty
> much any name you want based on it.


Thanks, I looked it up, it sounds like it would do the trick.

Also, according to this:

http://www.centos.org/docs/4/html/rh...nterfaces.html

By specifying the HWADDR field, you can bind a specific name to a
specific NIC. Have you ever tried it this way?

 
Reply With Quote
 
Stephane CHAZELAS
Guest
Posts: n/a

 
      11-08-2006, 08:19 AM
2006-11-7, 16:44(-08), (E-Mail Removed):
> Hello,
>
> How can I go about determining which card is assigned which name if I
> have more than one?
>
> At the moment, I have two NICs in a PC. Running ifconfig reveals the
> interface names along with the MAC addresses. Running lspci reveals the
> hardware information. But I don't know which NIC model got assigned
> what interface name.

[...]

ethtool -i eth<n>

tells you the name of the driver (in case the two NICs are
different makes).

$ sudo ethtool -i eth0
driver: via-rhine
version: 1.4.2
firmware-version:
bus-info: 0000:00:12.0

Also:

-p --identify
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.

If you don't have ethtool,

ls -l /sys/class/net/eth0/device
(in 2.6 kernels)

gives you something that you can feed lspci -s with:

$ ls -l /sys/class/net/eth0/device
lrwxrwxrwx 1 root root 0 Nov 8 08:26 /sys/class/net/eth0/device -> ../../../devices/pci0000:00/0000:00:12.0/
$ lspci -s 0000:00:12.0
00:12.0 Ethernet controller: VIA Technologies, Inc. VT6102 [Rhine-II] (rev 74)

The MAC address will tell you the Vendor:

$ ip link show eth0
2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
link/ether 00:11:5b:41:fc:63 brd ff:ff:ff:ff:ff:ff
$ grep -i 00115b /usr/share/nmap/nmap-mac-prefixes
00115B Elitegroup Computer System Co. (ECS)

(not sure about the relationship between ECS and VIA though).

--
Stéphane
 
Reply With Quote
 
Jiri Slaby
Guest
Posts: n/a

 
      11-08-2006, 01:59 PM
(E-Mail Removed) wrote:
>> Name 'em yourself! Google for ifrename. It lets you make a
>> determination based on just about anything you want, and assign pretty
>> much any name you want based on it.

>
> Thanks, I looked it up, it sounds like it would do the trick.


Also udev might help you with static naming.

--
js
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
fix a particular network card as ethx Ming-Ching Tiew Linux Networking 6 05-03-2006 10:15 PM
interface card question snow Wireless Internet 2 12-04-2004 05:05 AM
pegasus USB ethernet driver loading but no ethX interface Paul Gratz Linux Networking 0 10-15-2004 04:30 PM
network interface card disconnects wgl Windows Networking 0 12-26-2003 12:20 PM
network interface card Rollef Linux Networking 1 11-20-2003 09:39 AM



1 2 3 4 5 6 7 8 9 10 11