Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Mar 2012 09:15:57 +0330
From:      h bagade <bagadeh@gmail.com>
To:        Peter Jeremy <peterjeremy@acm.org>
Cc:        freebsd-net <freebsd-net@freebsd.org>
Subject:   Re: problem with vlan interfaces tagging/untagging in a simulated switch box
Message-ID:  <CAKWOZ6Uqwgw7ro=_Sn8ycUPtC2BAYiAuBKza4W8-WL-gNScKrg@mail.gmail.com>
In-Reply-To: <20120305222811.GA64183@server.vk2pj.dyndns.org>
References:  <CAKWOZ6VH5Jv9kd-QuCM3oiukwTUajMAOvmGeg1uofNa4A3UXjA@mail.gmail.com> <20120305084359.GA56606@server.vk2pj.dyndns.org> <CAKWOZ6Vog_uxEn8ea4Jm=RS_R0PHZ0Y9jndsFdn8OfHC5gPCNg@mail.gmail.com> <20120305222811.GA64183@server.vk2pj.dyndns.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 3/6/12, Peter Jeremy <peterjeremy@acm.org> 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,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAKWOZ6Uqwgw7ro=_Sn8ycUPtC2BAYiAuBKza4W8-WL-gNScKrg>