|
How to Configure Virtual IP Address in Linux |
|
|
|
|
Written by Amanatullah khalil
|
|
Saturday, 23 May 2009 |
-
Invoke the linuxconf tool. ( type linuxconf in the shell prompt and press Enter ). For starting this tool you have to be logged in as Super user. -
In the displayed menu, select the menu item : IP Aliases for virtual hosts and press Enter. This will display the two interfaces eth0 and lo. (Ethernet interfaces in Linux are called by such names as eth0 and eth1) -
Select eth0 and press Enter. This will show all the IP aliases configured for the selected interface. -
Example IP alias or range : 177.177.177.1-25 Netmask : 255.255.255.0 - In the field IP alias or range, enter the desired IP address or the range with a corresponding Netmask.
| | Note: -
These commands have to be executed with the super user privilege. -
You will have to re-start the system for the changes to take effect. -
When you are configuring a large number of IP address, it might take a long time to boot up. | Using the following command, we can configure Virtual IPs in the Linux box at run-time without re-booting the machine or re-starting the network. ifconfig eth0:1 172.19.1.2 netmask 255.255.255.0 up
ifconfig eth0:3 172.19.1.3 netmask 255.255.255.0 up The interface number must be unique for each interface (for example eth0:1, eth0:2 etc). The same interfaces can be made down by using the following command. ifconfig eth0:1 172.19.1.2 netmask 255.255.255.0 down
ifconfig eth0:3 172.19.1.3 netmask 255.255.255.0 down | | Note: -
These commands have to be executed with the super user privilege. -
It can be used in versions up to 7.2 -
The configurations will not be available when you re-start your system. - Thanks to http://techgurulive.com/2009/03/07/how-to-configure-virtual-ip-address-in-linux/
|
|
|
Last Updated ( Saturday, 23 May 2009 )
|