qemu + 802.1Q VLANs

Lowell Gilbert lowell at be-well.ilk.org
Fri Apr 7 18:20:38 UTC 2006


Oliver Fromme <olli at 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.  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


More information about the freebsd-net mailing list