I configured the bridge which are connected to guests to communicate with outside. And In the guest, i configure gateway to indicate the bridge IP. (currently achieve this with DHCP)
eth0 <–> bridge <–> guest
It’s surely works. But when i migrate (live migration), the problem arises. The guest network doesn’t work because the gateway in the guest have not changed and the guest consistently indicating the gateway bridge of the source host node. If i can use restarting the guest, it will be easy(editing libvrit xml file or configuring DHCP). But what i want to do live migration. More over i can’t use ssh to run command in a guest. Because i supposed not to know the username and the password of the guest. How can i automatically change the gateway of the guest to the appropriate gateway when i do live migration? I thought open vswitch can solve this issue. But it looks like that open vswitch can only change the routing and can’t change the gateway of the guest. Problem still there. If there are a way to run a command in the guest without ssh, it will be also appropriate. If i can do that, i could force the DHCP client of the guest to signal DHCPDISCOVERY. But sadly, this way is only available in vmware(VIX api). I can’t find corresponding feature in kvm.