QEMU networking quirkiness on 7.0

Mario Lobo mlobo at digiart.art.br
Fri Apr 11 11:16:31 UTC 2008


On Friday 11 April 2008 07:17:21 you wrote:
> Hi Mario,
>
> > ------------------------------------------------
> > 1) # rc.conf
> >
> > ifconfig_re0="up polling"               <- no IP here !
> > autobridge_interfaces="bridge0"
> > autobridge_bridge0="tap0 re0"     <- important even if tap0 does not
> > exist yet cloned_interfaces="bridge0"
> > # the bridge gets the IP
> > ifconfig_bridge0="inet 10.10.10.2 netmask 255.255.255.0"
> >
> > 2) tell QEMU launch to open a tap device
> >
> > 3) tap up script to run when invoking the machine(s).
> >
> > # qemu-net
> >
> > #!/usr/local/bin/bash
> > $1 = tap ifac created
> > /sbin/ifconfig $1 up
> > # test if tap is already added
> > TEST=`ifconfig -a | grep -A 6 bridge | grep $1`
> > if [ "$TEST" == "" ]; then
> >    /sbin/ifconfig bridge0 addm $1
> > fi
> > # add a route to the virtual machine
> > /sbin/route add -host 10.10.10.100 -iface bridge0
> >
> > ------------------------------------------------
> >
> > Set the gateway on both machines to the same gateway of the host.
> > That's all.
> >
> > This works perfectly for me. If I want both virtual machines up, I have
> > to add another route to the IP of the second machine through the bridge.
>
> I don't really understand why you need routing here.  In my
> understanding a bridge works like a layer 2 switch so there should be no
> need for any routing.
>
> Cheers,
>
>
> Andrew

I don't know exactly why. What I know is if I don't, it doesn't work.
I think it's because the virtual machine is on the same subnet of the bridge 
and the host is not configured as a gateway.

-- 
Mario Lobo
http://www.mallavoodoo.com.br
FreeBSD since version 2.2.8 [not Pro-Audio.... YET!!] (99,7% winedows FREE)


More information about the freebsd-questions mailing list