How To Configure KVM with a Public IP Address Network that is on a Different subnet
Linux - Virtualization and CloudThis forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
Last edited by sundialsvcs; 09-13-2011 at 07:54 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....
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.