Friday, July 20, 2007

IP aliasing - virtual IP howto

Do you need to setup IP aliasing or multiple ethernet IP address using your single ethernet card? Here are the steps to do that:

First requirement, you will be needing a working ethernet network interface card. Say your first ethernet is eth0 and has an IP address of . Issuing

# ifconfig eth0

would show you your current IP address and packet statistics with it. You can try this

Now adding 3 aliased IP address for example would similarly be:

# ifconfig eth0:0 broadcast netmask up
# ifconfig eth0:1 broadcast netmask up
# ifconfig eth0:2 broadcast netmask up

Now try to check your ethernet IP address

# ifconfig

would show you multiple aliased IP address with your single ethernet card.

Make sure you make them permanent between reboots, which can be done in many ways. One is to put them inside your /etc/rc.local .

This IP address changes is without consideration to advanced routing and ethernet load balancing.


Sign up for PayPal and start accepting credit card payments instantly.
ILoveTux - howtos and news | About | Contact | TOS | Policy