From owner-freebsd-net@FreeBSD.ORG Fri Apr 7 18:20:38 2006 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5B20016A403 for ; Fri, 7 Apr 2006 18:20:38 +0000 (UTC) (envelope-from lowell@be-well.ilk.org) Received: from mail6.sea5.speakeasy.net (mail6.sea5.speakeasy.net [69.17.117.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id 10A7843D49 for ; Fri, 7 Apr 2006 18:20:37 +0000 (GMT) (envelope-from lowell@be-well.ilk.org) Received: (qmail 28476 invoked from network); 7 Apr 2006 18:20:37 -0000 Received: from dsl092-078-145.bos1.dsl.speakeasy.net (HELO be-well.ilk.org) ([66.92.78.145]) (envelope-sender ) by mail6.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 7 Apr 2006 18:20:37 -0000 Received: by be-well.ilk.org (Postfix, from userid 1147) id 1597228423; Fri, 7 Apr 2006 14:20:37 -0400 (EDT) To: freebsd-net@freebsd.org References: <1144265008.00498663.1144252202@10.7.7.3> From: Lowell Gilbert Date: 07 Apr 2006 14:20:37 -0400 In-Reply-To: <1144265008.00498663.1144252202@10.7.7.3> Message-ID: <44odzdnt6y.fsf@be-well.ilk.org> Lines: 27 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: qemu + 802.1Q VLANs X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Apr 2006 18:20:38 -0000 Oliver Fromme writes: > I'm running FreeBSD/i386 RELENG_6 as a guest within qemu > on a FreeBSD host. Guest and host are connected through > the usual tap0/ed0 virtual ethernet. > > The host receives an 802.1Q VLAN trunk from a VLAN-capable > Cisco switch, and uses several VLANs from within that trunk. > I would like to access some of the VLANs from the guest OS > running in qemu, too, but haven't been able to find out how > to do that. > > So, here's the question: Is it possible to "forward" a > VLAN trunk into a qemu guest somehow, so that both host > and guest can use VLANs from it? Yes. [Fabulously useful technique, by the way; I have set up some very complicated test configurations on a single fiber this way.] You need to bridge to the guest's interface. I think this is the minimum example you'll need as a hint: ifconfig bridge0 create ifconfig vlan11 create ifconfig vlan11 vlan 11 vlandev ti0 up qemu -net nic,vlan=0,macaddr=52:54:00:12:12:01 -net tap,ifname=/dev/tap0,vlan=0 disk.image ifconfig bridge0 addm vlan11 addm tap0 up