IP Aliasing is the process of adding additional IP addresses to a single network interface.

Linux[edit | edit source]

Use the ip command to add or remove IP addresses from an interface.

# ip address add $ip/$mask dev $interface
# ip address del $ip/$mask dev $interface

To make it persistent, create a ifcfg script with the IP changes:

# cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0:0
# cat /etc/sysconfig/network-scripts/ifcfg-eth0:0

Ensure that there is no GATEWAY set in the ifcfg-eth0 file because it should be set in /etc/sysconfig/network.

FreeBSD[edit | edit source]

Under FreeBSD, to add an additional IP address (, with a netmask of to re0, run:

# ifconfig re0 netmask alias

The changes above are not persistent and will not survive a reboot. Add the following to /etc/rc.conf to make it persistent:

# ifconfig_re0_alias0=" netmask alias"