Search the FAQ Archives

3 - A - B - C - D - E - F - G - H - I - J - K - L - M
N - O - P - Q - R - S - T - U - V - W - X - Y - Z
faqs.org - Internet FAQ Archives

comp.sys.hp.hpux FAQ
Section - 5.7.3 How to get the MAC address for a particular network interface?

( Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Sex offenders ]


Top Document: comp.sys.hp.hpux FAQ
Previous Document: 5.7.2 How can I track network packets?
Next Document: 5.7.4 Is there a Transport Level Interface (TLI) interface to TCP on HP-UX?
See reader questions & answers on this topic! - Help others by sharing your knowledge
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 DLPI
  Path     Address        In# State NamePPA        ID  Type   Support Mjr#
  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 following:

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

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

Programmatically
================
The old (9.x) way to do this was by using the LLA (Link Level Access) API,
which is obsolete in 10.x/11.x.  The new way to do it is by using the DLPI
(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
<http://docs.hp.com/en/98194-90053/>.

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 environment.

For more information on DLPI programming, refer to the DLPI Programmer's
Guide (HP Part No. B2355-90139), available online at
<http://docs.hp.com/en/B2355-90139/>.

Side Note
=========
To figure out what vendor made your Ethernet card based on the MAC
address, check out <http://www.cavebear.com/CaveBear/Ethernet/vendor.html>.

User Contributions:

Comment about this article, ask questions, or add new information about this topic:




Top Document: comp.sys.hp.hpux FAQ
Previous Document: 5.7.2 How can I track network packets?
Next Document: 5.7.4 Is there a Transport Level Interface (TLI) interface to TCP on HP-UX?

Single Page

[ Usenet FAQs | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer:
hpux.faq@gmail.com





Last Update March 27 2014 @ 02:11 PM