alvaroag
18-05-2016, 15:47
The usual problem in cases like this one is the gateway outside of the subnet, which makes things more difficult, because you can't just set the gateway as gateway, but as two routes: one to reach the gateway, and another one to reach the internet through the gateway.
The best option for your case would be to change the network structure of your vm environment. Instead of using a eth0 bridge with vmacs, use eth0 alone for the host internet access, and a bridge where vms connect with the host. Then, you have two options: use proxyarp so each vm uses it's own public ip address; or use one to one nat, so each vm has a private ip which is translated into an exclusive public one. In both cases, you can setup a dhcp server which offers the ip configuration to the vm.
The best option for your case would be to change the network structure of your vm environment. Instead of using a eth0 bridge with vmacs, use eth0 alone for the host internet access, and a bridge where vms connect with the host. Then, you have two options: use proxyarp so each vm uses it's own public ip address; or use one to one nat, so each vm has a private ip which is translated into an exclusive public one. In both cases, you can setup a dhcp server which offers the ip configuration to the vm.