Assigning two IP addresses to one card

HP-UX 10.x

  1. Use /usr/contrib/bin/ifalias command (available for HP-UX 10.x from patch PHNE_12492)

  2. If the IP address is on the same subnet as original IP address

    ifalias interface action ipaddress

    e.g. ifalias lan0 add 141.228.160.3

  3. If the new IP address is on a different subnet as original IP address

    ifalias interface action subnet_mask ipaddress

    e.g. ifalias lan0 addmask 255.255.254.0 141.228.92.9

    Thanks to Sherwood Botsford for update on using ifalias for a different subnet

HP-UX 11.x

With HP-UX 11, ifalias has been dropped and the functionality included in the ifconfig command, in the format:

ifconfig lann:m address parameters

where n is the ppa number, e.g. 0 for device lan0 and m is the index number (lan0:0 would be same as lan0)

e.g. ifconfig lan0:1 145.245.12.5 255.255.0.0 up

Addresses may be in different subnets