From owner-freebsd-net@FreeBSD.ORG Tue Mar 6 05:45:59 2012 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBB1F106564A for ; Tue, 6 Mar 2012 05:45:58 +0000 (UTC) (envelope-from bagadeh@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 551F78FC08 for ; Tue, 6 Mar 2012 05:45:57 +0000 (UTC) Received: by bkcjc3 with SMTP id jc3so5214471bkc.13 for ; Mon, 05 Mar 2012 21:45:57 -0800 (PST) Received-SPF: pass (google.com: domain of bagadeh@gmail.com designates 10.204.141.10 as permitted sender) client-ip=10.204.141.10; Authentication-Results: mr.google.com; spf=pass (google.com: domain of bagadeh@gmail.com designates 10.204.141.10 as permitted sender) smtp.mail=bagadeh@gmail.com; dkim=pass header.i=bagadeh@gmail.com Received: from mr.google.com ([10.204.141.10]) by 10.204.141.10 with SMTP id k10mr12324521bku.51.1331012757272 (num_hops = 1); Mon, 05 Mar 2012 21:45:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=lIBWh6vIJfarO3tXehLHv+Lp4ctg8OlL3mD7catDoFo=; b=JuRxeQNthlpqvjsVGIa7zvmq+dsf4B9hgoGlAIdnvYSSroVgib6IPZhRxpw1uLhdAZ H0geKN5nqgsBA8eChLBVosMvSk0BDMTzUEwoullFoA+GoMtFZu677QuImyQYKiaitVW2 nWx2X4vGnBipJpmYQheWq+bdKMVwoAWlgda3BloaA7ouvja2CcYMPhuoQEToOzPn17W6 GMRfGOBf1wwNEV2TsVF4YCy3AL8XO1tBCHPhzupIyYy3m5RRNClPFlx289Sxd8WwPTmC UmXaivD6jeyAz9PpxPxvvDo08dyvflUvCwP/gfi1dNJvWN5h7/tYgPsh+hZ4TeGGNKWn zYqA== MIME-Version: 1.0 Received: by 10.204.141.10 with SMTP id k10mr9728430bku.51.1331012757186; Mon, 05 Mar 2012 21:45:57 -0800 (PST) Received: by 10.204.167.139 with HTTP; Mon, 5 Mar 2012 21:45:57 -0800 (PST) In-Reply-To: <20120305222811.GA64183@server.vk2pj.dyndns.org> References: <20120305084359.GA56606@server.vk2pj.dyndns.org> <20120305222811.GA64183@server.vk2pj.dyndns.org> Date: Tue, 6 Mar 2012 09:15:57 +0330 Message-ID: From: h bagade To: Peter Jeremy Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-net Subject: Re: problem with vlan interfaces tagging/untagging in a simulated switch box X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 05:45:59 -0000 On 3/6/12, Peter Jeremy wrote: > Please don't top-post. > > > OK. Sorry, I misunderstood what you were trying to achieve. I am > using FreeBSD as a router rather than a switch. That said, I suspect > your problem is that you are misunderstanding how VLAN tagging is > applied. If a packet flows through a vlan(4) device, the appropriate > tag is removed from incoming (from the network) packets and added to > outgoing (to the network) packets. Packets flowing through normal > ethernet devies (your ethX) without also flowing through a vlan(4) are > not tagged (and so will appear in the default vlan as far as an > external switch is concerned). Internally (ie as seen by bridge(4) > instances), packets are not tagged. > > The following example diagram shows 3 distinct packet flows: > - packets tagged 5 in trunk1 and 6 in trunk0 > - packets tagged 7 in trunk1 and 9 in trunk0 > - packets tagged 8 in trunk0 and 10 in trunk2 > > +-- vlan5 --- bridge1 --- vlan6 --+ > | | > trunk1 --- eth1 -+- vlan7 --- bridge2 --- vlan9 --+-- eth0 --- trunk0 > | > bridge3 --- vlan8 --+ > | > trunk2 -- eth2 --- vlan10 > > This would be configured as: > ifconfig vlan5 vlan 5 vlandev eth1 > ifconfig vlan6 vlan 6 vlandev eth0 > ifconfig vlan7 vlan 7 vlandev eth1 > ifconfig vlan8 vlan 8 vlandev eth0 > ifconfig vlan9 vlan 9 vlandev eth0 > ifconfig vlan10 vlan 10 vlandev eth2 > ifconfig bridge1 addm vlan5 addm vlan6 > ifconfig bridge2 addm vlan7 addm vlan9 > ifconfig bridge3 addm vlan8 addm vlan10 > > -- > Peter Jeremy > I've described the function of Cisco switches in vlan tagging/untagging. In your topology, packets should be tagged when recieved on real interfaces to be send out to vlan interfaces. It would be fine when two trunks are communicating because on both side packets are tagged. But as I mentioned before, Cisco switches receive packets on an interface untagged and then sending packets tagged out of trunk port, based on which interface it receives,