tc, VLAN, ebtables issue

Linux Advanced Routing and Traffic Control

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

 



Hi all,

I am testing one QOS system, I want to control bandwidth by VLAN id.
Here is my test network:

Internet Gateway
       |
       |
QOS control box ( Bridge box, Redhat 9, 2.4.28 kernel with
ebtables-brnf-8_vs_2.4.28 patch)
       |
       |
VLAN Switch
       |
       |
    PC  PC

In my QOS control box, it is a bridge box, I used Redhat 9, 2.4.28
kernel with ebtables-brnf-8_vs_2.4.28 patch, and used HTB to control BW.
Both sides NICs of the QOS box are e1000 , and in normal state, not VLAN
tagged.

I created a tagged VLAN for our PCs under the VLAN switch, our PCs can
go through the QOS box and Gateway to reach Internet.

On the QOS box, I setup the following rules:

# create class ( use HTB class)

/usr/sbin/tc qdisc del dev eth0 root 2> /dev/null > /dev/null 
/usr/sbin/tc qdisc del dev eth1 root 2> /dev/null > /dev/null 
/usr/sbin/tc qdisc add dev eth0 root handle 1: htb default 9 
/usr/sbin/tc class add dev eth0 parent 1: classid 1:1 htb rate 256kbps
ceil 256kbps 

/usr/sbin/tc class add dev eth0 parent 1:1  classid 1:9  htb rate 1kbps
ceil 256kbps prio 7 

## eth0 port class 
/usr/sbin/tc class add dev eth0 parent 1:1 classid 1:10 htb rate 1kbps
ceil 256kbps prio 0 
/usr/sbin/tc qdisc add dev eth0 parent 1:10 handle 10: sfq /usr/sbin/tc
class add dev eth0 parent 1:1 classid 1:11 htb rate 1kbps ceil 3kbps
prio 2 
/usr/sbin/tc qdisc add dev eth0 parent 1:11 handle 11: sfq


/usr/sbin/tc qdisc add dev eth1 root handle 1: htb default 9 
/usr/sbin/tc class add dev eth1 parent 1: classid 1:1 htb rate 256kbps
ceil 256kbps 

/usr/sbin/tc class add dev eth1 parent 1:1  classid 1:9  htb rate 1kbps
ceil 256kbps prio 7 

## eth1 port class 
/usr/sbin/tc class add dev eth1 parent 1:1 classid 1:10 htb rate 1kbps
ceil 256kbps prio 0 
/usr/sbin/tc qdisc add dev eth1 parent 1:10 handle 10: sfq /usr/sbin/tc
class add dev eth1 parent 1:1 classid 1:11 htb rate 1kbps ceil 2kbps
prio 2 
/usr/sbin/tc qdisc add dev eth1 parent 1:11 handle 11: sfq

Then  mark VLAN traffic:
ebtables -A FORWARD -p 802_1Q --vlan-id 103 -j mark --set-mark 2
--mark-target CONTINUE

Then classify VLAN traffic to the specify class
/usr/sbin/tc filter add dev eth0 parent 1: protocol ip prio 2 handle 2
fw classid 1:11

But the result is: the VLAN id 103 traffic go to the default class 1:9,
not go to the class 1:11 as we expected.

>From the stat of ebtables, I can see there are bytes count in the VLAN
id 103 mark chain, ebtables marked the VLAN id 103 traffic; but from the
stat of class, I can see that no traffic go to the class 1:11 we expect.
It as if Tc can not classify these marked tfaffic.

My idea is that controlling by VLAN id. 

Any good idea, comments on my issue? Are my above rules right? 

Thank in advance!

BR
Kingz


_______________________________________________
LARTC mailing list / LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux