Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Apr 2006 16:41:44 +0200 (CEST)
From:      Oliver Fromme <olli@lurza.secnetix.de>
To:        freebsd-net@FreeBSD.ORG
Subject:   Re: qemu + 802.1Q VLANs
Message-ID:  <200604101441.k3AEfiua090651@lurza.secnetix.de>
In-Reply-To: <44odzdnt6y.fsf@be-well.ilk.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Lowell Gilbert <lowell@be-well.ilk.org> wrote:
 > Oliver Fromme <olli@lurza.secnetix.de> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200604101441.k3AEfiua090651>