From owner-freebsd-net@freebsd.org Sat Nov 25 09:32:05 2017 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B20F5DC0EDF for ; Sat, 25 Nov 2017 09:32:05 +0000 (UTC) (envelope-from buchtajz@borsice.net) Received: from smtpsec.sitkom.cz (smtpsec.sitkom.cz [IPv6:2a03:3a00:1:2::9:25]) by mx1.freebsd.org (Postfix) with ESMTP id 6FAB07B2B2 for ; Sat, 25 Nov 2017 09:32:05 +0000 (UTC) (envelope-from buchtajz@borsice.net) Received: from [IPv6:2a03:3a00:2:a00:458a:ef8b:9fd9:334b] (unknown [IPv6:2a03:3a00:2:a00:458a:ef8b:9fd9:334b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtpsec.sitkom.cz (Postfix) with ESMTPSA id BC0677BB8 for ; Sat, 25 Nov 2017 10:31:54 +0100 (CET) Subject: Re: vlans + bridging is "interesting" To: freebsd-net@freebsd.org References: <20171125014755.GN42467@funkthat.com> From: =?UTF-8?Q?Michal_Bucht=c3=adk?= Message-ID: <7b55197b-8f9d-6a54-3db4-70d4fc52abd0@borsice.net> Date: Sat, 25 Nov 2017 10:32:01 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171125014755.GN42467@funkthat.com> Content-Type: text/plain; charset=iso-8859-2; format=flowed Content-Transfer-Encoding: 7bit Content-Language: cs X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Nov 2017 09:32:05 -0000 Hi, maybe i don't understand you needs, but why do you create bridge0 and add local ip's to it?. When you would like to see untaged packets on VM, to this simple setup: keep em0 as "trunk" interface create interface em0.14 create bridge14 and add to it interfaces tap0 and em0.14 add local ip to bridge14 ifconfig em0.14 create ifconfig em0.14 up ifconfig bridge14 create ifconfig bridge14 addm tap0 addm em0.14 ifconfig bridge14 up ifconfig bridge14 then your VM will can communicate (untagged) with your host system, and you will see tagged packets on em0 (and untagged on em0.14 of course) Michal Dne 25.11.2017 v 2:47 John-Mark Gurney napsal(a): > Hello, > > I decided to try to run some bhyve VM's on my machine and bridge > them to a guest vlan on my main interface. I also want to support > running bhyve VM's on the untagged part of the interface as well > (this is the key problem as I'll describe later). > > I configure it as you'd expect. Bridge the main interface em0, and > put the local IP's on the bridge0. Then I added an interface em0.14 > that untags packets from em0, and added it to bridge1 along w/ a tap0 > for the VM. This does not work. Packet goes out and comes back and > is observed on em0, but never appears on either em0.14 or bridge1. > > After seeing: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=139268 > > I decide to look on bridge0, and see the tagged vlan packet on that > interface. I attempted to add bridge0 as the vlandev for em0.14, but > that doesn't work: > #ifconfig em0.14 vlan 14 vlandev bridge0 > ifconfig: SIOCSETVLAN: Protocol not supported > > So, I did finally get things working by using epair. I added an epair > to the bridge, and that allows me to untag the packet, and pass on to > bridge1. > > I have not attempted to use the patch in 139268, but if people think > it is an acceptable solution (with patch, if I set LINK0, it should work > w/ original configuration), I'll test and commit the patch. > > Otherwise, please submit another fix. > > Thanks. >