LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Virtualization and Cloud (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/)
-   -   How To Configure KVM with a Public IP Address Network that is on a Different subnet (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/how-to-configure-kvm-with-a-public-ip-address-network-that-is-on-a-different-subnet-902195/)

moe007 09-09-2011 03:47 PM

How To Configure KVM with a Public IP Address Network that is on a Different subnet
 
I'm not sure if I am phrasing this question properly but would like to be able to configure my KVM environment (On a Centos 6 Box) to utilize a Public IP address space that's on a different subnet. How would I be able to do that? If someone could help me out it would be greatly appreciated.

jefro 09-11-2011 10:53 AM

I only use qemu so I can't exactly know for sure.

Almost all VM's support one of 3 ways to connect network.

One is bridged. The VM uses the host nic's addresses. So that may or may not work but remember a host nic could have two or more IP addresses so keep that in mind.

Second is a NAT. Nat is really a part of the vm. It is a virtual hardware router. You VM connects to the virtual router and the virtual router connects to your hosts subnet.

This is where you have to know the answer. If your subnet is on the same physical layer then you can do either of the choices. If it is not on the same layer then you need other things changed.

sundialsvcs 09-13-2011 07:53 AM

You're going to have to have an external router that can be programmed to have that IP-address, and it will have to use NAT to forward the traffic, through one of the IP-addresses assigned to that physical box, which will then have to forward the traffic to the virtual machine and present it to the VM correctly. It can be a little bit tricky, but conceptually it's actually simple: the traffic has to get through that physical NIC in order to get to any of the virtual machines that are running on it. The VMs themselves don't have to know where they are (and they shouldn't), but this little bit of hanky-waving is a physical requirement of making the illusion work.

moe007 09-13-2011 08:12 AM

This is a dedicated server that I'm renting and the provider, I would assume, has all the routing in place. I was able to configure the additional IP's on the box and I am able to ping them however I am unsure how to configure the VM's to route through the new IP's....

jefro 09-13-2011 02:50 PM

Explain what you want to do. Do you want the VM's to only talk between each other?

moe007 09-13-2011 02:56 PM

I would like the VM's to be able to talk to each other as well as being able to be accessed via a Public IP address.


All times are GMT -5. The time now is 12:43 AM.