0

I have a CentOS 6 box that has two IP Addresses on one physical interface - One the IP assigned to the interface via the netconfig scripts, and the second a "virtual" IP assigned to the same interface via a pacemaker service. I would like to change the "physical" IP address, but I don't want to disrupt any connections to the virtual IP address. Is this possible, and if so, how?

Always before when I wanted to change an IP, I would simply modify the netconfig script and then run service network restart, but I would think that would terminate any connections to the virtual IP.

3

Generally I do like your current approach as that will ensure that you end up with a tested & valid configuration and no nasty surprises upon next reboot. But the ip command should meet your needs:

ip address add NEWIFADDR dev STRING
ip addr del OLDIFADDR dev STRING
1
  • While that worked to change the IP without restarting the interface, as soon as I deleted the old IP address I lost the virtual IP as well. pcs status showed the service as stopped, and I couldn't figure out any way to get it to start again, short of deleting and recreating the virtual IP service. So, unfortunately, while it looked promising that approach didn't work. – ibrewster Jan 5 '16 at 20:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.