I have one physical server running kvm with 4 vms on it. For each vm i used an own IP address. Now my colocation provider is changing all IPs. What is the update strategy? Log in on each vm and re-configure /etc/network/interface ? Then change the IP of the physical server and reboot?
Asked
Active
Viewed 1,594 times
1 Answers
3
It should not be necessary to reboot to reconfigure the IP addresses. You could try:
- Add new address to the server with appropriate routing.
- Add new address to the VMs, or replace the addresses on the VMs. (This is only necessary if the server is not NATing the addresses for the VMs. If they have private IP addresses leave them as is.)
- Restart any services which are only listening on the old address.
- Change the default gateway on the server once that address is fully routeable by your colocation provider.
- Change the default gateway on the VMs.
- Remove the old addresses from the VMs once all connections on those addresses have closed. (May require service restarts in some cases.)
- Remove the old address from the server.
You can change /etc/network/interfaces
and just use ifup
and ifdown
to configure and unconfigure the addresses. Using the command nohup /etc/init.d/network/restart 2>&1
is a more robust restart.
If you have a separate management port or are working from the console you can skip the nohup
in the above command. Using ifdown
on the primary configuration (eth0) should only be done if you are not connected over that interface.

BillThor
- 27,737
- 3
- 37
- 69