Network config for KVM on physical machine with single NIC and single public IP

Posted by neo0 on Server Fault See other posts from Server Fault or by neo0
Published on 2013-11-06T17:23:45Z Indexed on 2013/11/08 3:59 UTC
Read the original article Hit count: 472

Filed under:

I have a physical machine running CentOS 6.4 and I will rent a place to run it in a data center. I want to install KVM on that machine to run some virtual machines.

The problem is my physical machine have only one NIC and the data center give me a public IP for that interface. So how should I configure network on the physical machine to make it assign for each vm a private IP that can connect to Internet.

If I create a br0 bridged with eth0 interface and create a vm with option --bridge=br0 then KVM could not assign an IP for the vm so setup can not be done.

Should I use NAT mode? Does KVM have any host-only network like Virtualbox? But the vm still has to connect to outside?

Thank you!

Update

I install the guest network using NAT (--network network:default) and then I only have to port-forwarding from the host.

But if I config br0 bridged with physical eth0 then the guest can not get an IP from boot. So I removed the br0 and it worked.

© Server Fault or respective owner

Related posts about kvm-virtualization