From owner-freebsd-net@freebsd.org Sun Dec 11 17:34:50 2016 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 DD148C7236A for ; Sun, 11 Dec 2016 17:34:50 +0000 (UTC) (envelope-from tetragir@fastmail.fm) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B26DE1EEC for ; Sun, 11 Dec 2016 17:34:50 +0000 (UTC) (envelope-from tetragir@fastmail.fm) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 9BC29207B7 for ; Sun, 11 Dec 2016 12:34:49 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Sun, 11 Dec 2016 12:34:49 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.fm; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=xjVeXd2loxjO8Cm Gdk9OLI/IlqA=; b=cql6jncwLjoVg4wIgg4n7GecQI5LWS6F3kK3BjC0IRbQa2L cGkV0SF5y1YA1VomVrMFCMiWO5EXdiDEgY731ikdYSslrHfBV2kZ59P8Sp8LZbth aZPJD9+2Ip38p+I2thnEEVxXlW6dcO0Gd/yY/3dY9AEPc0R0v4M2ZUQX9hWc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= smtpout; bh=xjVeXd2loxjO8CmGdk9OLI/IlqA=; b=DRuNZK+oQlJmmP5IMWsM DwyLsAqr2bJtPl4Jtb8WYD1feOlb7NtT3fD0MyJ8grSvkfiH4LbVepIORlNSeJQ3 xuEpfAqR1RMvd4+1XUWN4aAbn7nOwwYmV1+cZeiOQIXvMC67yYhoLEYk26sMau7Z N0n/jbvmNzHf6Yu9eNR/4O4= X-ME-Sender: X-Sasl-enc: AfMOtUz96w+hO69Qd3wZbaMZq49PVaQxceBlmXTiEsev 1481477689 Received: from cerebro.tetragir.local (hsi-kbw-046-005-000-129.hsi8.kabel-badenwuerttemberg.de [46.5.0.129]) by mail.messagingengine.com (Postfix) with ESMTPA id 2C0477E808 for ; Sun, 11 Dec 2016 12:34:49 -0500 (EST) Message-ID: <1481477688.1299.6.camel@fastmail.fm> Subject: Re: bce vlan stripping limitations From: Daniel Tihanyi To: freebsd-net@freebsd.org Date: Sun, 11 Dec 2016 18:34:48 +0100 In-Reply-To: References: <1C233AAF-E7F3-4FE9-8936-A36F827F4137@public-internet.co.uk> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.2 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Dec 2016 17:34:51 -0000 Hi, Hardware VLAN stripping is not really what you need right now, you are looking for VLAN tagging. If a network interface can send and receive tagged packets, it looks something like this: %ifconfig em0 inet em0: flags=8843 metric 0 mtu 1500 options=4219b Despite the network interface not supporting hardware VLAN tagging you can still use VLANs, but it will be done in software. 1. Add the following line to /boot/loader.conf: if_vlan_load="YES" 2. Reboot, or load the kernel module manually: # kldload if_vlan 3. To create the VLAN interface, add the following line to /etc/rc.conf: vlans_bce0="304" ifconfig_bce0_304="up" This interface will be named named bce0.304 4. Add this interface to bridge1, again in /etc/rc.conf: cloned_interfaces="bridge1 tap1" ifconfig_bridge1="addm bce0.304 addm tap1" 5. Reboot, or issue this command: # service netif restart This way every packet coming from the bhyve guest will be tagged with VLAN 304 by the host and also every packet which comes tagged with VLAN 304 will be passed to tap1. Daniel On Sun, 2016-12-11 at 15:27 +0000, Tom Beard via freebsd-net wrote: > Keen observers will have noticed that I pasted the output from the > wrong vlan1.  The correct output is below. > > vlan1: flags=8942 metric > 0 mtu 1500 >         ether 84:2b:2b:0b:b3:72 >         nd6 options=29 >         media: Ethernet autoselect (1000baseT ) >         status: active >         vlan: 304 vlanpcp: 0 parent interface: bce0 >         groups: vlan  > > > On 11 Dec 2016, at 14:44, Tom Beard via freebsd-net > eebsd.org> wrote: > > > > Hi all > > > > I’m having issues with vlan handling on a bce interface on 11.0- > > RELEASE.  From what I’ve read, the bce driver supports hardware > > vlan stripping and is indeed doing this.  My intent was to create a > > vlan interface bound to the bce interface and bridge this to a tap > > interface to use with a bhyve VM (as below).   > > > > Outbound traffic from the VM is correctly bridged from tap1 to > > vlan1 then tagged with vlan 304 and passed out on bce0 > > > > Inbound traffic tagged with vlan 304 on bce0 never makes it to > > vlan0. > > > > From what I can tell this is caused by vlan stripping on the bce0 > > interface and it looks like I can’t disable it leaving me with > > little option but to buy a new network card. > > > > Can anyone validate that I’m correct here and this is a known > > limitation or am I barking up completely the wrong tree? > > > > Thanks > > Tom > > > > bce0: mem 0xda000000- > > 0xdbffffff irq 36 at device 0.0 on pci1 > > > > bce0: flags=8943 > > metric 0 mtu 1500 > >        options=80028 > >        ether 84:2b:2b:0b:b3:72 > >        nd6 options=29 > >        media: Ethernet autoselect (1000baseT ) > >        status: active > > > > bridge1: flags=8843 metric > > 0 mtu 1500 > >        ether 02:eb:af:cf:7c:01 > >        nd6 options=1 > >        groups: bridge  > >        id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15 > >        maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200 > >        root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0 > >        member: tap1 flags=143 > >                ifmaxaddr 0 port 11 priority 128 path cost 2000000 > >        member: vlan1 flags=143 > >                ifmaxaddr 0 port 9 priority 128 path cost 55 > > > > vlan1: flags=8102 metric 0 mtu 1500 > >        ether 00:00:00:00:00:00 > >        nd6 options=29 > >        vlan: 0 vlanpcp: 0 parent interface: > >        groups: vlan  > > > > tap1: flags=8943 > > metric 0 mtu 1500 > >        options=80000 > >        ether 00:bd:3a:17:4c:02 > >        nd6 options=29 > >        media: Ethernet autoselect > >        status: active > >        groups: tap  > >        Opened by PID 12880 > > > > _______________________________________________ > > freebsd-net@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/freebsd-net > > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.o > > rg" > > _______________________________________________ > freebsd-net@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org > "