Thursday, January 23, 2014

Create a Virtual IP Address in Linux [ temporary ]

This post will detail how to set ip a virtual IP address and assign an interface to handle the traffic in the Linux OS. This may not work for all Linux distros but it should be accurate for most.

Run the ifconfig command to see what interfaces are available.
Run the ifconfig command again, however this time create a Virtual IP using the following syntax.
Example:
Substitute INTERFACE = the interface which this VIP will be based on, IP_ADDRESS = the new VIP IP address (note: this must exist) and NETMASK = the netmask of the new VIP.
Update the routing table using arping.
Example:
Substitute INTERFACE with the interface to bind this VIP to and VIP_IP_ADDRESS to the VIP IP address which was assigned in the above ifconfig statement.

Note: changes made will be lost when the machine is rebooted.

No comments:

Post a Comment