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

VanLUG Email Archive

Re: Reading an Ethernet card's hardware address?

Slava Voronin
Thu, 15 Oct 1998 10:33:40 -0700

Dave Michelson wrote:

> Adrian Glover wrote:
> >
> > Dave Michelson wrote:
> >
> > > 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 just installed NT first, and it told me everything I needed to know. I/O
> > port, IRQ, everything. May not be your ideal solution, but hey, it works
> > in a pinch.
>
> Sorry, I should have been more clear. I'm looking for a generic method (say,
> a set of procedure calls) which allows a process to determine the hardware
> addresses of any Ethernet cards installed in a Linux x86 system.
>
> check in /proc/net/arp on your box
> IP address HW type Flags HW address Mask Device
> 24.113.0.1 0x1 0x2 00:60:5C:74:9B:A1 *
> $
> 192.168.1.2 0x1 0x2 00:40:05:36:38:A3 *
> $
> 192.168.3.3 0x1 0x2 00:E0:29:13:D0:0B *
> $
>
> if you want get MAC address on ather box do like this

vcnet:~# ping 192.168.1.2
PING 192.168.1.2 (192.168.1.2): 56 data bytes
64 bytes from 192.168.1.2: icmp_seq=0 ttl=64 time=0.8 ms

--- 192.168.1.2 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 0.8/0.8/0.8 ms
vcnet:~#

vcnet:~# arp -n 192.168.1.2

> Address HWtype HWaddress Flags Mask Iface
>
> 192.168.1.2 ether 00:40:05:36:38:A3 C eth1
> vcnet:~#
>