1829265 Members
1696 Online
109988 Solutions
New Discussion

Virtual IP

 
Jojo Castro
Regular Advisor

Virtual IP

Hi all,

I am planning to add virtual IP on our production server. Just to be sure my procedure will not affect the current production, can anyone provide me the "correct and safe" procedure in adding and deleting virtual IP on Linux?

Thanks!
7 REPLIES 7
Ivan Ferreira
Honored Contributor

Re: Virtual IP

Are you talking about an "alias"? That is, another IP address to the same network adatper?

If so, then you can use:

ifconfig eth0:1

ifconfig eth0:1 192.168.0.1 255.255.255.0

To disable the interface

ifconfig eth0:1 down
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Jojo Castro
Regular Advisor

Re: Virtual IP

Is this permanent? that this will also be in effect when I reboot the server?
Jeeshan
Honored Contributor

Re: Virtual IP

create a file named ifcfg-eth0:0 in /etc/sysconfig/network-scripts folder and enter the following lines

DEVICE=eth0:0 (or whatever you want)
BOOTPROTO=none
ONBOOT=yes
IPADDR=x.x.x.x (your ip address)
NETMASK=x.x.x.x (your net mask)

now this is permanent. then enter the command

#ifup eth0:0

#ping <0 ip="" address="">

or if you wanna make sure you can rebbot the server.

it will not take any effect to any other service.
a warrior never quits
Jojo Castro
Regular Advisor

Re: Virtual IP

This is it? I don't add any information like Broadcast ip etc...?

Thanks

Jeeshan
Honored Contributor

Re: Virtual IP

actually no need to add any broadcast IP for this.
a warrior never quits
Jojo Castro
Regular Advisor

Re: Virtual IP

ok thanks
Jojo Castro
Regular Advisor

Re: Virtual IP

thanks to all for the replies