Traduisez - Übersetzen - Traduzca - Traduza - Tradurre - Translate

VanLUG Email Archive

Re: Reading an Ethernet card's hardware address?

Slava Voronin
Thu, 15 Oct 1998 10:00:24 -0700

Dave Michelson wrote:

> Hi, all.
>
> Can anyone point me towards material which explains how one might read the
> hardware addresses of any Ethernet cards installed in a Linux x86 system?
>
> I'm not talking about autoprobing. I'm hoping that a safer, more generic
> method can be employed once the appropriate driver/module has been loaded.

if I understand correctly you asked for MAC address of ethernet card?

vcnet:~# ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Bcast:127.255.255.255 Mask:255.0.0.0
UP BROADCAST LOOPBACK RUNNING MTU:3584 Metric:1
RX packets:17194 errors:0 dropped:0 overruns:0 frame:0
TX packets:17194 errors:0 dropped:0 overruns:0 carrier:0
Collisions:0

eth0 Link encap:Ethernet HWaddr 00:20:78:12:52:71 - --- this is MAC
address which is unique for each NIC.
inet addr:192.168.3.1 Bcast:192.168.3.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2822 errors:0 dropped:0 overruns:0 frame:0
TX packets:4501 errors:0 dropped:0 overruns:0 carrier:0
Collisions:0
Interrupt:11 Base address:0x6500

eth1 Link encap:Ethernet HWaddr 00:40:05:40:29:52
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:14191 errors:0 dropped:0 overruns:0 frame:0
TX packets:11819 errors:0 dropped:0 overruns:0 carrier:0
Collisions:229
Interrupt:3 Base address:0x6600

eth2 Link encap:Ethernet HWaddr 00:40:05:31:2A:CF
inet addr:24.113.3.19 Bcast:24.113.3.255 Mask:255.255.252.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:643598 errors:5 dropped:0 overruns:0 frame:5
TX packets:11817 errors:0 dropped:0 overruns:0 carrier:0
Collisions:418
Interrupt:12 Base address:0x6700