From owner-freebsd-questions@FreeBSD.ORG Fri Apr 11 10:14:00 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36342106564A for ; Fri, 11 Apr 2008 10:14:00 +0000 (UTC) (envelope-from andrew@farnborough.darq.net) Received: from farnborough.darq.net (fab.darq.net [82.136.41.2]) by mx1.freebsd.org (Postfix) with ESMTP id EAF0A8FC13 for ; Fri, 11 Apr 2008 10:13:59 +0000 (UTC) (envelope-from andrew@farnborough.darq.net) Received: from localhost (localhost [127.0.0.1]) by farnborough.darq.net (Postfix) with ESMTP id 005C31D0FD; Fri, 11 Apr 2008 11:17:25 +0100 (BST) X-Virus-Scanned: amavisd-new at darq.net Received: from farnborough.darq.net ([127.0.0.1]) by localhost (farnborough.darq.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NYpY8Rc-BwGm; Fri, 11 Apr 2008 11:17:21 +0100 (BST) Received: by farnborough.darq.net (Postfix, from userid 1057) id 3474F1D0EB; Fri, 11 Apr 2008 11:17:21 +0100 (BST) Date: Fri, 11 Apr 2008 11:17:21 +0100 From: Andrew Cid To: Mario Lobo Message-ID: <20080411101720.GA31959@farnborough.darq.net> References: <80f4f2b20804081710k5af28466k17f3d38cdd6e344a@mail.gmail.com> <20080410093625.GA95076@farnborough.darq.net> <80f4f2b20804100833v3fdc2f79ufcf6b109ddd4ae9b@mail.gmail.com> <200804101908.14015.mlobo@digiart.art.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200804101908.14015.mlobo@digiart.art.br> User-Agent: Mutt/1.5.11 Cc: freebsd-questions@freebsd.org Subject: Re: QEMU networking quirkiness on 7.0 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2008 10:14:00 -0000 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 -- accid.net