Monday, February 18, 2008

Can a system have multiple IPs?


Hi Folks,

I'm back after long time with some info.

Big Question:
Can a system have multiple IPs?
Small Answer: Yes!

Here's how...

we can configure four IPs on the same linux-box as follows:

  • Login to the linux-box.
  • Assume that the 4 IPs you need are 192.168.10.44, 192.168.10.45, 192.168.10.46 and 192.168.10.47 (Check whether these IPs are available. Ensure that these IPs are not already in use).
  • Go to /etc/sysconfig/network-scripts/
  • Make 4 copies of the file ifcfg-eth0 as ifcfg-eth0:1, ifcfg-eth0:2, ifcfg-eth0:3, ifcfg-eth0:4
  • Edit each of these files to contain only these two lines as follows :

---------------------------------
IPADDR=192.168.10.44
NETMASK=255.255.255.0
---------------------------------
---------------------------------
IPADDR=192.168.10.45
NETMASK=255.255.255.0
---------------------------------
---------------------------------
IPADDR=192.168.10.46
NETMASK=255.255.255.0
---------------------------------
---------------------------------
IPADDR=192.168.10.47
NETMASK=255.255.255.0
---------------------------------
After editing them, issue a service network restart command
on the linux-box prompt.
Now, the ifconfig command should show all these IPs configured.


Well, the requirement of multiple IPs may be various.


Never say "What's there in a name"... Happy IP-ing... :-)

Cheers!
Mallik