Create virtual / alias IP address

This is the code to make an alias IP address on network interface ethX where X is a number to indicate the device we are attaching the IP.
ifconfig eth0:1 netmask up
Your machine will now answer on ping requests

You can see the result by running the command

ifconfig eth0:1


eth0:1    Link encap:Ethernet  HWaddr xx:xx:xx:xx:xx:xx
          inet addr:  Bcast:  Mask:
          Interrupt:17 Base address:0x1080

To take down this alias use

ifup eth0:1 down

You might experience that the new device/address won’t answer network requests to the IP address after moving it. This happens because the arp cache on the router most likely haven’t discovered that the IP address is on a new MAC address. A solution to this problem is to clear the arp info on the router using the arprelease command

arprelease eth0:1

This command can be downloaded from if it isn’t available on your linux distribution.