Getting the Ethernet Address?

Chris Torek chris at mimsy.umd.edu
Fri Feb 9 01:02:11 AEST 1990


In article <12763 at vicorp.UUCP> patrick at vicorp.UUCP (Patrick Johnstone) writes:
>I've been slogging through the Unix manuals trying to find a way to get
>the Ethernet address of my system.

What makes you think that a system as *an* Ethernet address?  We have
a number of machines with 2 or more Ethernets, and a few with none
(because their underlying network is not Ethernet).

>... I'm interested in getting the raw Ethernet address (the one with
>format %x:%x:%x:%x:%x:%x).

There is no generally-available 4BSD or SunOS ioctl to read an Ethernet
address from an interface, but there is a generally-available ioctl to
read an ARP address.  Hence, if your Ethernet uses ARP to implement
Internet address translation, you can bounce a packet off the IP address
(forcing an ARP query) and then ask for the ARP entry with SIOCGARP
or with /etc/arp.

If you have 4.3BSD and run the Xerox NS protocols, the Ethernet address
of an interface appears as part of the XNS address.  (XNS runs only on
Ethernets and things that allow themselves to be addressed as if they
were Ethernets.)
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris at cs.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.unix.questions mailing list