[plug] Ethernet Addresses

Christian christian at amnet.net.au
Thu May 4 11:57:41 WST 2000


On Thu, May 04, 2000 at 11:49:11AM +0800, Mike Holland wrote:
> On Thu, 4 May 2000, Christian wrote:
> 
> > Does anyone know how to find out the ethernet (MAC) address of a given
> > interface?  After searching the manual I can't find any system calls
> 
> The arp(8) and ifconfig(8) commands give the MAC ("hardware") address.
> An strace(1) will show which system calls they use, but i cant see any
> special system calls.
>   You could read /proc/net/arp, or exec the 'arp' command for more
> portability.

Will these give that information prior to an address being assigned to
the interface?

>   Looking at the solaris man pages, I find arp(4p), which tells how to
> use <net/if_arp.h> and socket/ioctl calls. Gross!
> Linux seems to have the same header file, so I'll send the man page, but
> gee its ugly.

Looking at the Linux documentation it hasn't been updated since 1995
(Linux 1.3.27) so please do send me that Solaris page! :)

Regards,

Christian.



More information about the plug mailing list