How can multiple IP addresses be configured on one interface?

How can multiple IP addresses be configured on one interface? Updated: 11/18/01


ifalias
=======
On 10.x, a patch can be installed that adds a new command called ifalias,
allowing one to add multiple IP addresses on one interface without having
to buy MC/ServiceGuard:

o For 10.20: PHNE_12492
o For 10.10: PHNE_7108
o For 10.01: PHNE_7107
0 For 10.00: not available

After installing the patch, see the ifalias(1M) manpage. The command's
syntax is very straightforward:

# ifalias lanX add <address_list>

where X is the interface number, and <address_list> is the list of IP
addresses you wish to alias.

It is also a good idea to install the latest ARPA Transport patch:

o For 10.20: PHNE_22507
o For 10.10: PHNE_19935
o For 10.01: PHNE_20188
o For 10.00: PHNE_13474

ifconfig
========
On 11.x, no additional patches are required, and one does not use the
ifalias command. The functionality is part of the ifconfig(1M) command.
For additional aliases on the same physical interface, one would do:

# ifconfig lanX:0 ...
# ifconfig lanX:1 ...
...
# ifconfig lanX:N ...

where X is the interface number. Note, 'lanX' is equivalent to 'lanX:0'.

To persist the configuration, modify /etc/rc.config.d/netconf. The
format
should resemble the following:

INTERFACE_NAME[0]="lan0"
IP_ADDRESS[0]=13.13.10.1
SUBNET_MASK[0]=255.255.255.0
BROADCAST_ADDRESS[0]=""
INTERFACE_STATE[0]=""
DHCP_ENABLE[0]=0

INTERFACE_NAME[1]="lan0:1"
IP_ADDRESS[1]=13.13.20.15
SUBNET_MASK[1]=255.255.255.0
BROADCAST_ADDRESS[1]=""
INTERFACE_STATE[1]=""
DHCP_ENABLE[1]=0

Again, it is a good idea to install the latest ARPA Transport patch:

o For 11.11: PHNE_27063
o For 11.00: PHNE_27886

cmmodnet
========
HP's MC/ServiceGuard product also allows you to configure multiple IP
addresses on one interface, using the cmmodnet command which adds IP
addresses to existing interfaces. For example:

# cmmodnet -a -i 15.13.169.16 15.13.143

Where -a is add, -i 15.13.169.16 is the IP address to add, and 15.13.143
is the subnet on which to add it. The cmmodnet command (via the
ioctl()s)
then figures out which interface the subnet is currently on and adds
the new IP address to that interface.

VIF
===
Similar functionality for HP-UX 9.x can be obtained using the VIF kernel
driver by Steinar Haug <sthaug@nethelp.no>. For more info, see:

o <http://www.nethelp.no/net/vif/readme.html>



Home
FAQ