Tag Archives: lanadmin command

How to find MAC address of LAN card in HPUX

Different ways to find the MAC address of LAN card in HPUX. Learn how to use lanscan, lanadmin, print_manifest, SAM to check MAC.

MAC addresses also known as station addresses can be found physically on LAN cards which are mostly PCI cards on your HP server. Obviously being hardware, it’s not always feasible to open up just to get MAC address! Another way is to get these details from the OS command. You can use lanscan, lanadmin, sam, print_manifest command to get the MAC address of the LAN card in HPUX.

First, you need to get a LAN number on which your expected IP is configured. You can use netstat -nvr to check all IP configured on the system and their respective LAN number.

# netstat -nvr
Routing tables
Dest/Netmask                    Gateway            Flags   Refs Interface  Pmtu
127.0.0.1/255.255.255.255       127.0.0.1          UH        0  lo0        4136
12.123.51.123/255.255.255.255   12.123.51.123      UH        0  lan0       4136
12.125.101.123/255.255.255.255  12.125.101.123     UH        0  lan1       4136
12.123.48.0/255.255.252.0       12.123.51.123      U         2  lan0       1500
12.125.96.0/255.255.248.0       12.125.101.123     U         2  lan1       1500
127.0.0.0/255.0.0.0             127.0.0.1          U         0  lo0        4136
default/0.0.0.0                 12.123.51.1        UG        0  lan0       1500

Look at the interface column to get lanX number. For example, we will try to get the MAC of lan1 interface.

lanscan command

lanscan command without any argument will give you station address i.e. MAC addresses of all available LAN on the system.

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

Look station address and column and check the value against lan1! lan1 has MAC of 0x001A3B08C4A1.

lanadmin command

This is not straight forward as lanscan command. After issuing lanadmin command you will be presented with lanadmin console prompt where you can use lanadmin commands. Example below.

# /usr/sbin/lanadmin


          LOCAL AREA NETWORK ONLINE ADMINISTRATION, Version 1.0
                       Mon, Apr 17,2017  18:10:09

               Copyright 1994 Hewlett Packard Company.
                       All rights are reserved.

Test Selection mode.

        lan      = LAN Interface Administration
        menu     = Display this menu
        quit     = Terminate the Administration
        terse    = Do not display command menu
        verbose  = Display command menu

Enter command: lan

Here type command lan You will be greeted with the LAN interface mode prompt like below.

LAN Interface test mode. LAN Interface PPA Number = 0

        clear    = Clear statistics registers
        display  = Display LAN Interface status and statistics registers
        end      = End LAN Interface Administration, return to Test Selection
        menu     = Display this menu
        ppa      = PPA Number of the LAN Interface
        quit     = Terminate the Administration, return to shell
        reset    = Reset LAN Interface to execute its selftest
        specific = Go to Driver specific menu

Enter command: ppa

Enter command ppa and change your number to 1 since we are checking lan1 in our example. Default is set to lan0

Enter command: ppa
Enter PPA Number.  Currently 0: 1

LAN Interface test mode. LAN Interface PPA Number = 1

Once LAN interface PPA changed to 1 hit command display and you will be shown all details of that lan card including station address!

Enter command: display

                      LAN INTERFACE STATUS DISPLAY
                       Mon, Apr 17,2017  18:10:26

PPA Number                      = 1
Description                     = lan1 HP PCI-X 1000Base-T Release PHNE_36237 B.11.11.15
Type (value)                    = ethernet-csmacd(6)
MTU Size                        = 1500
Speed                           = 1000000000
Station Address                 = 0x1a3b08c4a1
Administration Status (value)   = up(1)
Operation Status (value)        = up(1)
Last Change                     = 185
Inbound Octets                  = 1362884960
Inbound Unicast Packets         = 1309204600
----- output clipped -----

Here you can pad two zeros in from of station address to make it perfect 12 alphanumeric MAC. Means 1a3b08c4a1 becomes 001a3b08c4a1.

Using SAM

You can even use SAM (text based GUI tool) to get these details. Go to,

SAM -> Networking and communications -> Network Interface Cards

Select your lan (in our case lan1) using a space bar (it will be highlighted). Then choose Actions from the menu bar to get details.

Using print_manifest

If you have Ignite installed on the server then you can try print_manifest command to get all system details. Those details also include MAC of all lan cards. The only issue is your LAN PPA number won’t be available here in output to match MAC with lan id.

# /opt/ignite/bin/print_manifest
System Hardware

    Model:              9000/800/rp4440
    Main Memory:        24574 MB
    Processors:         8
    Processor(0) Speed: 999 MHz
    Processor(1) Speed: 999 MHz
    Processor(2) Speed: 999 MHz
    Processor(3) Speed: 999 MHz
    Processor(4) Speed: 999 MHz
    Processor(5) Speed: 999 MHz
    Processor(6) Speed: 999 MHz
    Processor(7) Speed: 999 MHz
    OS mode:            64 bit
    LAN hardware ID:    0x001A3B08C4A0
    LAN hardware ID:    0x001A3B08C4A1
    Software ID:        Z3e1372908dc9758e
    Keyboard Language:  Not_Applicable

----- output clipped ------