I have 5 physical machines running Ubuntu 14.04, all of them are together in a network. These all have static IP addresses. Each of these machines has 1 to 4 virtual machines via KVM/QEMU running Ubuntu 14.04. I'm allowed to use DHCP to get a non-static address for all the virtual machines on the physical network.But for my distributed software, I need all the virtual machines to have static IP addresses within the virtual network (as I cannot get more on the physical network). This virtual network should however span all the guests on all the virtual machines. Also, one of the virtual machines should also have a static address on the physical network.
I have managed to create a virtual network in a single host for all the virtual machines, so these can have static IPs there, but if I do this per host, it won't work. I have also created a bridged interface for the static IP on the physical network on one of the virtual machines.
This is my desired scheme:
220.127.116.11/28 (physical network) 192.168.0.0/16 (virtual network for all the vms) 18.104.22.168 (host) 192.168.122.101, 22.214.171.124 (vm) 192.168.122.102 (vm) 192.168.122.103 (vm) 192.168.122.104 (vm) 126.96.36.199 (host) 192.168.122.105 (vm) 188.8.131.52 (host) 192.168.122.106 (vm) 184.108.40.206 (host) 192.168.122.107 (vm) 192.168.122.108 (vm) 220.127.116.11 (host) 192.168.122.109 (vm) 192.168.122.110 (vm)
Here are outputs of ifconfig:
One of the hosts:
eth0 Link encap:Ethernet HWaddr 5c:f9:dd:75:07:72 inet addr:18.104.22.168 Bcast:22.214.171.124 Mask:255.255.248.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 virbr0 Link encap:Ethernet HWaddr 52:54:00:bd:2b:39 inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Virtual machine that has both bridged interface (eth1) and an interface for the virtual network (eth0)
eth0 Link encap:Ethernet HWaddr 52:54:00:59:2d:c8 inet addr:192.168.122.101 Bcast:192.168.122.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 eth1 Link encap:Ethernet HWaddr 52:54:00:4d:d0:59 inet addr:126.96.36.199 Bcast:188.8.131.52 Mask:255.255.248.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
After hours of googling, I was unable to find a similar setup of the problem I'm facing. As my familiarity with networks is rather low, I'd be appreciative for any leads to a solution.