Pbs with TC and Bridging...

Sebastien Uzeel (drizzt@alternative-advice.com)
Mon, 13 Dec 1999 16:46:53 +0100


Hi,

I want to do traffic control via an IP-IP Bridge, like this:

10.1.*.* -------- (eth1)Bridge(eth0)-------10.0.*.*

I have set tc for eth0, with this script:

------------
#! /bin/bash
TC=/sbin/tc
DEVICE=eth0
BANDWIDTH="bandwidth 10Mbit"

$TC qdisc add dev $DEVICE root handle 1: cbq $BANDWIDTH avpkt 1000 mpu 64

$TC class add dev $DEVICE parent 1:0 classid 1:1 cbq $BANDWIDTH rate 100Mbit allot
1514 cell 8 weight 10Mbit prio 3 maxburst 20 avpkt 1000 bounded

$TC class add dev $DEVICE parent 1:1 classid 1:2 cbq $BANDWIDTH rate 64Kbit allot
1514 cell 8 weight 6Kbit prio 1 maxburst 20 avpkt 1000 split 1:0 defmap 0x0

$TC class add dev $DEVICE parent 1:1 classid 1:3 cbq $BANDWIDTH rate 99Mbit allot
1514 cell 8 weight 9Mbit prio 2 maxburst 20 avpkt 1000 split 1:0 defmap 0xffff

$TC filter add dev $DEVICE parent 1:0 prio 3 protocol ip u32

$TC filter add dev $DEVICE parent 1:0 prio 3 handle 1: u32 divisor 256

$TC filter add dev $DEVICE parent 1:0 prio 3 u32 ht 1:17: match ip dport 0x1388
0xffff flowid 1:2
$TC filter add dev $DEVICE parent 1:0 prio 3 u32 ht 1:6: match ip dport 0x1388
0xffff flowid 1:2

$TC filter add dev $DEVICE parent 1:0 prio 3 handle ::1 u32 ht 800:: match ip
nofrag offset mask 0x0F00 shift 6 hashkey mask 0x00ff0000 at 8 link 1:

--------------
The problem is that when a packet have a destination to 10.1.*.*:5000 (in hexa =
0x1388), the packets
continue to pass through the flowid 1:3 (In fact the default flow). Moreover, by
watching packets with tcpdump,
I've seen that they aren't fragmented, so it can't be that.

I have made a test by giving eth0 an ip adress, for example 10.0.0.2, and sending
packet from it , with a 'matching' of: 'ip src 10.0.0.2 flowid 1:2.
This works.

But when I set a 'matching' of: 'ip src 10.0.0.4 flowid 1:2' , and sending packet
from 10.0.0.4, it doesn't work too.

Does anyone have an idea where I am wrong? I've search for many hours and didn't
find anything...

Can we do traffic control with tc via a bridge, or is it the problem I've met???

Thx in advance!

Seb.

-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.rutgers.edu