Network config for KVM on physical machine with single NIC and single public IP
- by neo0
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.