Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Im configuring my router to give preference to some WAN interfaces. This interfaces are named ppp0 (PPP interface), vc2 (RFC1483 bridge interface) and vc3 (RFC1483 bridge interface). I had understood with bridge interfaces that forwarding is done at layer 2 so iptables not even 'see' the outgoing traffic of this bridge interfaces. Indeed i can in my router set with 'ip rule' traffic from all as prohibited and i can still stablish PPPOE connection from LAN to WAN through bridge interfaces. If forwarding is done at L2 with bridge interfaces how TOS field can be marked so IP QoS can be done?.

Anyway using busybox shell in my CLI router interface i can get information about this queuing disciplines by default:

...
qdisc pfifo_fast 0: dev vc0 root bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: dev vc2 root bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: dev vc3 root bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1

So far so good, but i can configure QoS queue via web interface of my router using a table that allows sorting interfaces by precedence:

Interface       Description     Precedence     Queue ID 
ppp0_vc0        8_32_p0         0               1       
vc2             8_37_p1         1               2       
vc3             10_35_p2        2               3 

With the configuration above i hope outgoing traffic from ppp0 is dequeue before outgoint traffic from vc2 is dequeue. When the configuration above is enabled i get:

#tc qdisc
......
qdisc prio 1: dev vc0 root bands 4 priomap  2 3 3 2 1 1 0 0 1 1 1 1 1 1 1 1
qdisc pfifo 2: dev vc0 parent 1:1 limit 10p
qdisc pfifo 3: dev vc0 parent 1:2 limit 10p
qdisc pfifo 4: dev vc0 parent 1:3 limit 10p
qdisc pfifo 5: dev vc0 parent 1:4 limit 10p
qdisc prio 1: dev vc2 root bands 4 priomap  2 3 3 2 1 1 0 0 1 1 1 1 1 1 1 1
qdisc pfifo 2: dev vc2 parent 1:1 limit 10p
qdisc pfifo 3: dev vc2 parent 1:2 limit 10p
qdisc pfifo 4: dev vc2 parent 1:3 limit 10p
qdisc pfifo 5: dev vc2 parent 1:4 limit 10p
qdisc prio 1: dev vc3 root bands 4 priomap  2 3 3 2 1 1 0 0 1 1 1 1 1 1 1 1
qdisc pfifo 2: dev vc3 parent 1:1 limit 10p
qdisc pfifo 3: dev vc3 parent 1:2 limit 10p
qdisc pfifo 4: dev vc3 parent 1:3 limit 10p
qdisc pfifo 5: dev vc3 parent 1:4 limit 10p

New iptables rules are created too:

#cat iptables -nvL -t mangle
....
Chain FORWARD (policy ACCEPT 6621 packets, 616K bytes)
pkts bytes target     prot opt in     out     source                   destination         
 1671  157K m_ipq_dft  all  --  *      *       0.0.0.0/0                0.0.0.0/0          
 1670  157K m_ipq_user  all  --  *      *       0.0.0.0/0                0.0.0.0/0        
....
Chain m_ipq_dft (1 references)
pkts bytes target     prot opt in     out     source                   destination         
 1436  134K CLASSIFY   all  --  br0    *       0.0.0.0/0                0.0.0.0/0          tos match 0x0/0xe0 CLASSIFY set 0:0 
    0     0 CLASSIFY   all  --  br0    *       0.0.0.0/0                0.0.0.0/0          tos match 0x20/0xe0 CLASSIFY set 0:1 
    0     0 CLASSIFY   all  --  br0    *       0.0.0.0/0                0.0.0.0/0          tos match 0x40/0xe0 CLASSIFY set 0:2 
    0     0 CLASSIFY   all  --  br0    *       0.0.0.0/0                0.0.0.0/0          tos match 0x60/0xe0 CLASSIFY set 0:3 
    0     0 CLASSIFY   all  --  br0    *       0.0.0.0/0                0.0.0.0/0          tos match 0x80/0xe0 CLASSIFY set 0:4 
    0     0 CLASSIFY   all  --  br0    *       0.0.0.0/0                0.0.0.0/0          tos match 0xa0/0xe0 CLASSIFY set 0:5 
    0     0 CLASSIFY   all  --  br0    *       0.0.0.0/0                0.0.0.0/0          tos match 0xc0/0xe0 CLASSIFY set 0:6 
0     0 CLASSIFY   all  --  br0    *       0.0.0.0/0                        0.0.0.0/0          tos match 0xe0/0xe0 CLASSIFY set 0:7 

I have read about queuing disciplines here http://lartc.org/. I understand that the tc output above displayed means that traffic on each interface goes to band 0,1,2,3 depending on the value of TOS field. I dont understand the iptables rules classifyng traffic from br0 (br0 groups LAN interfaces + vc2 + vc3) in 0:1..0:7 classes because i dont see this classes in 'tc qdisc' output.

Seen previous output I dont see how traffic from ppp0 has more precedence that traffic from vc1 (like i configured via web interface) and im not sure if iptables rules can be applied on bridge interfaces.

share|improve this question
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.