[VLAN] How to VLAN-tag untagged frames and filter VLAN tagged frames at the same time

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I want to achieve the following goal using the 8021q.o and vconfig
components, but I can not find a way to do it.
Here is the scenario I want to support on my Linux platform:


eth0         _____________  ofdm0
-------------|  station  |-------------
             |           |
             -------------

My station bridges together an ethernet interface (eth0) with a wireless
interface (ofdm0).

The eth0 link is hybrid (VLAN tagged and untagged can travel on the
link)

My requirements are the following:
In the direction eth0 ---> ofdm0, I want to :
        1) VLAN tag the untagged ethernet frames with VLAN ID=4
        2) Filter the VLAN tagged ethernet frames so that only those
with VLAN ID=5 and ID=6 go through

In the direction eth0 <---- ofdm0, I want to :
        1) Untag the VLAN tagged ethernet frames with VLAN ID=4
        2) Discard all the other frames except the ones VLAN tagged with
ID=5 and ID=6 (i.e. VLAN untagged frames and VLAN tagged frames with
ID !=4, !=5 and != 6)


Here is what I tried:

I)
vconfig add eth0 5
vconfig add ofdm 5
brctl addbr br5
brctl addif br5 eth0.5
brctl addif br5 ofdm.5
ifconfig br5 up

II)
vconfig add eth0 6
vconfig add ofdm 6
brctl addbr br6
brctl addif br5 eth0.6
brctl addif br5 ofdm.6
ifconfig br6 up

Sets of commands I and II implement the filtering functionality (items
2) in my requirements above). So far, only the VLAN tagged frames with
ID=5 or ID=6 go through the station. All is O.K.
Here are my bridges on my station at this point:
/sub/lm_scripts # brctl show
bridge name     bridge id               STP enabled     interfaces
br6             8000.0013b5010160       yes             eth0.6
                                                        ofdm.6
br5             8000.0013b5010160       yes             eth0.5


Now I add the following commands:
III)
vconfig add ofdm 4
brctl addbr br4
brctl addif br4 eth0
brctl addif br4 ofdm.4
ifconfig br4 up

The brctl show commands outputs:
  /sub/lm_scripts # brctl show
  bridge name     bridge id               STP enabled     interfaces
  br4             8000.0013b5010160       yes             eth0
                                                          ofdm.4
  br6             8000.0013b5010160       yes             eth0.6
                                                          ofdm.6
  br5             8000.0013b5010160       yes             eth0.5
                                                          ofdm.5
  /sub/lm_scripts #


The behavior is that all the ethernet frames are going through the
bridge br4, and as a consequence, VLAN tagged frames are not bridged
properly anymore.


On the other hand, if I type only the set of commands III, I do very
well the VLAN tagging-untagging, but I obviously do not have the
filtering functionality. How can I achieve, at the same time, the two
functionalities (requirements) that I want to implement (VLAN tag-untag,
and filter VLAN tagged frames).


For your information
--------------------
In order to test this, I have the following IP routes and VLAN devices
on my end station connected to the eth0 link:
[root@wt0272 ~]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use
Iface
11.0.0.0        *               255.0.0.0       U     0      0        0
eth0.5
12.0.0.0        *               255.0.0.0       U     0      0        0
eth0.6
13.0.0.0        *               255.0.0.0       U     0      0        0
eth0
[root@wt0272 ~]#
[root@wt0272 ~]#
[root@wt0272 ~]# cat /proc/net/vlan/config
VLAN Dev name    | VLAN ID
Name-Type: VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD
eth0.5         | 5  | eth0
eth0.6         | 6  | eth0
[root@wt0272 ~]#

I just ping on the different IP segments to generate my ethernet frames
with different VLAN tags (or no VLAN tag). I have a similar
configuration at the end station on the ofdm link of the setup.

Thanks.

Philippe O'Reilly
poreilly@xxxxxxxxxxx


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux