Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

HOW TO qemu guest in the same host network (bridge mode)

Share your HowTo, Documentation, Tips and Tricks. Not for support questions!.
Post Reply
Message
Author
networker_
Posts: 12
Joined: 2011-07-03 23:25

HOW TO qemu guest in the same host network (bridge mode)

#1 Post by networker_ »

Hi

It was hard to me figure out this so I want to share briefly how I managed this after read a lot of confusing (to me) documentation.

Let's assume:
- physical host behind a router with eth0
- qemu VM already created

and you want the VM be in the same network than host as if another physical machine.

[HOST]

ifconfig eth0 0.0.0.0
brctl addbr br0
brctl addif br0 eth0

****if you have dhcp: *******
dhclient br0

**** or if you want static IP *******

in interfaces change eth0 by br0
auto br0
iface br0 inet static
address 172.30.50.90/24
dns-nameservers 172.30.50.1
gateway 172.30.50.1
bridge_ports eth0
bridge_stp off
bridge_fd 0
bridge_maxwait 0

restart networking service

br0 must be allowed in /etc/qemu/bridge.conf
echo "allow br0" >> bridge.conf

# ls -l /etc/qemu/bridge.conf
-rw-r----- 1 root qemu 10 oct 16 17:49 /etc/qemu/bridge.conf

start vm
# qemu-system-x86_64 -m 256 myVM.raw -net nic -net bridge,br=br0

[GUEST]

edit /etc/network/interfaces with regular static conf
edit resolv.conf if necessary
restart networking service


##########

Cheers

Post Reply