How to get the MAC address for a particular network

How to get the MAC address for a particular network interface?

Added: 04/09/01

From the command-line
Run lanscan(1M).

The output will look similar to this:

Hardware Station Crd Hdw Net-Interface NM MAC HP-DLPI
Path Address In# State NamePPA ID Type Support
0/0/0/0 0x00306E06C47D 0 UP lan0 snap0 1 ETHER Yes 119
0/2/0/0 0x001083FB9956 1 UP lan1 snap1 2 ETHER Yes 119

The output will have one entry for each LAN card in the computer. The
second field ("Station Address") is the MAC address.

To get the MAC addresses of another machine on the LAN, try the

$ ping {hostname} -n 1
$ arp -a | grep {hostname}

where {hostname} is the hostname or IP address of the remote machine.

The old (9.x) way to do this was by using the LLA (Link Level Access)
which is obsolete in 10.x/11.x. The new way to do it is by using the
(Data Link Provider Interface) API, LLA's replacement. For information
on migrating your code from LLA to DLPI, refer to chapter one of the LLA
Programming and Migration Guide (HP Part No. 98194-90053) at

You might want to check for a "logical" MAC address, rather than the
physical, if the software is going to be used in a switchover

For more information on DLPI programming, refer to the DLPI Programmer's
Guide (HP Part No. B2355-90139), available online at

Side Note
To figure out what vendor made your Ethernet card based on the MAC
address, check out