From owner-freebsd-net@FreeBSD.ORG Mon Apr 10 14:41:52 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 5B54416A401 for ; Mon, 10 Apr 2006 14:41:52 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8F63443D49 for ; Mon, 10 Apr 2006 14:41:51 +0000 (GMT) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (wfwnet@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id k3AEfiO0090652 for ; Mon, 10 Apr 2006 16:41:49 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.4/8.13.1/Submit) id k3AEfiua090651; Mon, 10 Apr 2006 16:41:44 +0200 (CEST) (envelope-from olli) Date: Mon, 10 Apr 2006 16:41:44 +0200 (CEST) Message-Id: <200604101441.k3AEfiua090651@lurza.secnetix.de> From: Oliver Fromme To: freebsd-net@FreeBSD.ORG In-Reply-To: <44odzdnt6y.fsf@be-well.ilk.org> X-Newsgroups: list.freebsd-net User-Agent: tin/1.8.0-20051224 ("Ronay") (UNIX) (FreeBSD/4.11-STABLE (i386)) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Mon, 10 Apr 2006 16:41:50 +0200 (CEST) Cc: Subject: Re: qemu + 802.1Q VLANs X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-net@FreeBSD.ORG List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2006 14:41:52 -0000 Lowell Gilbert wrote: > 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. Ah, bridge ... Thanks for the hint. I was looking in the directions of IPFW FWD, net.inet.ip.forwarding, netgraph and similar things. Using bridge didn't cross my mind for some reason. :-) > 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 Well, that would feed vlan11 into the qemu guest, right? What I need is to feed the whole trunk into the quemu guest, so I can do create the vlan interfaces within the guest. Would it work to bridge the whole (physical) trunk interface into the guest? i.e. following your example: ifconfig bridge0 addm ti0 addm tap0 up Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. "I have stopped reading Stephen King novels. Now I just read C code instead." -- Richard A. O'Keefe