Using network aliases to have multiple IPs

Posted by Amit Shah on July 04, 2007

If you have a network at home (or office) and get IP addresses assigned by a DHCP server (router, DSL modem, etc.), but want to address individual machines by a static IP (because you run servers on them), you should define network aliases, which enable you to define multiple IP addresses for a single network device. For example, if you have one network card that shows up as eth0, you can define an alias as eth0:0 and use another IP address. This can be used for hooking up onto multiple networks via the same network card as well.

All you need to do is edit your /etc/network/interfaces to contain the definition for eth0:0.

Here's a link that shows an example config and also talks about doing similar stuff in dhclient.conf, but I've not tried that.