[CentOS-virt] KVM + bridge + static ip address

Raymond C. Rodgers sinful622 at gmail.com
Fri Aug 8 16:27:50 UTC 2008

Hi folks,
 I've been reading through the list a bit, and also looked at the KVM 
How-To on the wiki (http://wiki.centos.org/HowTos/KVM ) but I still have 
a question. I haven't yet begun to set up KVM, so I haven't made any 
mistakes yet. :-)

 My company recently rented a server on which CentOS 5.0 is installed, 
and my goal is to set up a virtualized instance of CentOS for a new 
employee to tinker and learn on before I let him have hands on the real 
server. What I want to do is set up CentOS in KVM, and assign it one of 
the unused IP addresses on the server so that he and I can access it 
without having to first connect to the real server. The wiki didn't 
really give me a good idea of how to accomplish this, and I haven't done 
a bridge before, so I wanted to check with the list to see if I could 
get some advice on how to accomplish this.

 For demonstration purposes, lets say that the external IP address of 
the real server is, and I want the virtualized install to be 
found at Can someone show me how to modify the kvm rules found 
on the wiki (and pasted below) to accomplish this?


sudo brctl addbr br0
sudo ifconfig eth0
sudo brctl addif br0 eth0
sudo ifconfig br0 netmask up
sudo route add -net netmask br0
sudo route add default gw br0
sudo tunctl -b -u john
sudo ifconfig tap0 up
sudo brctl addif br0 tap0
sudo iptables -I RH-Firewall-1-INPUT -i br0 -j ACCEPT
qemu-kvm ~/win2k.img -m 512 -net nic -net tap,ifname=tap0,script=no

More information about the CentOS-virt mailing list