Re: [gentoo-user] which NIC is which?

2010-11-15 Thread YoYo Siska
On Mon, Nov 15, 2010 at 12:35:35PM +0100, Stefan G. Weichinger wrote:
> Am 15.11.2010 10:39, schrieb Steffen Loos:
> 
> > Maybe a little bit late but:
> > As a summary-tool all the info is gattered and shown by lshw.
> 
> yep, thanks.
> 
> Although it should be possible to just ask the kernel somehow, shouldn't it?

I usually do (especially from a livecd, when I want to know which
drivers to enable in the kernel for a new device ;)

y...@desktop ~ $ ls -l /sys/class/net/eth?/device/driver
lrwxrwxrwx 1 root root 0 2010-11-15 14:38 /sys/class/net/eth1/device/driver -> 
../../../../bus/pci/drivers/tulip
lrwxrwxrwx 1 root root 0 2010-11-15 14:38 /sys/class/net/eth2/device/driver -> 
../../../../bus/pci/drivers/r8169

yoyo




Re: [gentoo-user] which NIC is which?

2010-11-15 Thread Stefan G. Weichinger
Am 15.11.2010 10:39, schrieb Steffen Loos:

> Maybe a little bit late but:
> As a summary-tool all the info is gattered and shown by lshw.

yep, thanks.

Although it should be possible to just ask the kernel somehow, shouldn't it?



Re: [gentoo-user] which NIC is which?

2010-11-15 Thread Steffen Loos

Am 12.11.2010 23:31, schrieb Stefan G. Weichinger:

Am 12.11.2010 22:12, schrieb Etaoin Shrdlu:

On Fri, 12 Nov 2010 21:01:50 + Etaoin Shrdlu
wrote:


Also modprobe -k


I obviously meant lspci -k, though probably rereading the question, it's
not what he wanted.


Thanks to all of you, I think I got it now!

"modprobe -k" is non-existant here, "ethtool -i ethX" is what I was
looking for ...


Maybe a little bit late but:
As a summary-tool all the info is gattered and shown by lshw.

Steffen



Re: [gentoo-user] which NIC is which?

2010-11-12 Thread Stefan G. Weichinger
Am 12.11.2010 22:12, schrieb Etaoin Shrdlu:
> On Fri, 12 Nov 2010 21:01:50 + Etaoin Shrdlu 
> wrote:
> 
>> Also modprobe -k  
> 
> I obviously meant lspci -k, though probably rereading the question, it's
> not what he wanted.

Thanks to all of you, I think I got it now!

"modprobe -k" is non-existant here, "ethtool -i ethX" is what I was
looking for ...

Stefan



Re: [gentoo-user] which NIC is which?

2010-11-12 Thread Etaoin Shrdlu
On Fri, 12 Nov 2010 21:01:50 + Etaoin Shrdlu 
wrote:

> Also modprobe -k  

I obviously meant lspci -k, though probably rereading the question, it's
not what he wanted.



Re: [gentoo-user] which NIC is which?

2010-11-12 Thread Etaoin Shrdlu
On Fri, 12 Nov 2010 22:31:09 +0200 Fatih Tümen 
wrote:

> On Fri, Nov 12, 2010 at 21:14, Stefan G. Weichinger 
> wrote:
> > I want to somehow find out the relation between loaded kernel-module and
> > ethernet-devicefile. Without physical access ...
> >
> > In another way: "Which kernel-module is in use for /dev/ethX ?"
> >
> 
> # ethtool -i eth1
> driver: foo_driver
> version: 22-Aug-2005
> firmware-version: FOO Ethernet Device
> bus-info: usb-:00:03.3-1.4
> 
> # ifconfig eth1 | grep HW
> eth1  Link encap:Ethernet  HWaddr 00:00:00:00:00:00

Also modprobe -k



Re: [gentoo-user] which NIC is which?

2010-11-12 Thread Fatih Tümen
On Fri, Nov 12, 2010 at 21:14, Stefan G. Weichinger  wrote:
> I want to somehow find out the relation between loaded kernel-module and
> ethernet-devicefile. Without physical access ...
>
> In another way: "Which kernel-module is in use for /dev/ethX ?"
>

# ethtool -i eth1
driver: foo_driver
version: 22-Aug-2005
firmware-version: FOO Ethernet Device
bus-info: usb-:00:03.3-1.4

# ifconfig eth1 | grep HW
eth1  Link encap:Ethernet  HWaddr 00:00:00:00:00:00

--
Fatih



Re: [gentoo-user] which NIC is which?

2010-11-12 Thread Stefan G. Weichinger
Am 12.11.2010 18:51, schrieb Etaoin Shrdlu:

> mii-tool -w eth0
> 
> Also look at ethtool -p (details in the man page).

Yep, thanks. Maybe I haven't explained exactly what I mean:

I want to somehow find out the relation between loaded kernel-module and
ethernet-devicefile. Without physical access ...

In another way: "Which kernel-module is in use for /dev/ethX ?"

For example I have Intel-Servers with two Intel-NICs, one needs e1000,
the other e1000e. If that server is 100 kms away I 'd like to be able to
ask the system "does eth0 run on e1000 or e1000e?".

For udev the trick with grepping the rules-file is somehow nice. I
assume there would also some other way to ask udevd itself?

dmesg as well, although I think there should be a way to find that
connection even when I did a "dmesg -c" somehow.

"lspci -v" tells me about the loaded module for the pci-device, fine.
But even with "-vvv" I don't see the link over to the MAC or something
like that.

Thank you all, Stefan



Re: [gentoo-user] which NIC is which?

2010-11-12 Thread Etaoin Shrdlu
On Fri, 12 Nov 2010 16:51:58 +0100 "Stefan G. Weichinger" 
wrote:
 
> Maybe stupid question:
> 
> How to find out which physical NIC is for example eth0 ?
> 
> If I have 2 NICs in the box, for example one e1000 and one from 3com,
> how to find out which one is eth0 ?
> 
> I looked up /etc/udev/rules.d/70-persistent-net.rules where the MAC is
> determining the devicefile ...
> 
> Is there another way? on non-udev-systems?
> Just curious!

mii-tool -w eth0

then plug in/out a cable from every interface in sequence until you see
the above command detecting a link state change; that will be eth0.
Repeat with the other interfaces.

Also look at ethtool -p (details in the man page).



Re: [gentoo-user] which NIC is which?

2010-11-12 Thread Stefan G. Weichinger
Am 12.11.2010 16:57, schrieb Colt Jones:
> I usually do one of two things. Depending on the situation.
> 
> If both NICs are from the same vendor I install mii-tool and only plug
> in one port. mii-tool will show link state. This when it negotiates it
> will show output like:
> 
> eth0: negotiated 1000baseT-FD flow-control, link ok
> eth1: no link

OK, yes. This needs physical access and, as you said, depends on the
situation.

> If the NICs are from different vendors I usally just do a ifconfig and
> grab the MAC addresses of the cards. Then I Google for a mac lookup
> tool. The first 6 digits of a MAC are vendor specific.
> 
> Hope this helps!

Yep, thank you!




Re: [gentoo-user] which NIC is which?

2010-11-12 Thread Stefan G. Weichinger
Am 12.11.2010 17:41, schrieb Tom H:

>> Is there another way? on non-udev-systems?
> 
> dmesg | grep ethX

I looked that up, there was nothing!

Could be that I someday back then did a "dmesg -c" (I have an issue on
that server that triggered quite many lines in dmesg).

Thanks, S



Re: [gentoo-user] which NIC is which?

2010-11-12 Thread Tom H
On Fri, Nov 12, 2010 at 10:51 AM, Stefan G. Weichinger  wrote:
>
> How to find out which physical NIC is for example eth0 ?
>
> If I have 2 NICs in the box, for example one e1000 and one from 3com,
> how to find out which one is eth0 ?
>
> I looked up /etc/udev/rules.d/70-persistent-net.rules where the MAC is
> determining the devicefile ...
>
> Is there another way? on non-udev-systems?

dmesg | grep ethX



Re: [gentoo-user] which NIC is which?

2010-11-12 Thread Colt Jones
I usually do one of two things. Depending on the situation.

If both NICs are from the same vendor I install mii-tool and only plug in
one port. mii-tool will show link state. This when it negotiates it will
show output like:

eth0: negotiated 1000baseT-FD flow-control, link ok
eth1: no link

If the NICs are from different vendors I usally just do a ifconfig and grab
the MAC addresses of the cards. Then I Google for a mac lookup tool. The
first 6 digits of a MAC are vendor specific.

Hope this helps!

Colt


On Fri, Nov 12, 2010 at 7:51 AM, Stefan G. Weichinger wrote:

>
> Maybe stupid question:
>
> How to find out which physical NIC is for example eth0 ?
>
> If I have 2 NICs in the box, for example one e1000 and one from 3com,
> how to find out which one is eth0 ?
>
> I looked up /etc/udev/rules.d/70-persistent-net.rules where the MAC is
> determining the devicefile ...
>
> Is there another way? on non-udev-systems?
> Just curious!
>
> Thanks, Stefan
>
>