shapping over the same interface

Linux Advanced Routing and Traffic Control

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

 



Hi all
I'm new to the list and new to tc

I'm triying to shape incoming and outgoing traffic for every IP in a LAN. I'm using cbq classes because i need to use cbq.init script (partner's restrictions). Well, according to cbq.init documentation i have to define two classes for every IP

#cbq-0002-incoming-192.168.0.2
DEVICE=eth0,10Mbit,1Mbit
RULE=,192.168.0.2
BOUNDED=yes
PRIO=5
RATE=256Kbit
WEIGHT=25.6Kbit
LEAF=sfq

#cbq-0003-outgoing-192.168.0.2
DEVICE=eth0,10Mbit,1Mbit
RULE=192.168.0.2,
BOUNDED=yes
PRIO=5
RATE=64Kbit
WEIGHT=6.4Kbit
LEAF=sfq

The behavior of this es very extrange because all traffic from and to 192.168.0.2 is shaped by cbq-0002-incoming-192.168.0.2

The code equivalent to that classes is this:
----------------------------
tc qdisc del dev eth0 root
tc qdisc add dev eth0 root handle 1 cbq bandwidth 10Mbit avpkt 1000 cell 8
tc class change dev eth0 root cbq weight 1Mbit allot 1514

tc class add dev eth0 parent 1: classid 1:2 cbq bandwidth 10Mbit rate 256Kbit weight 25.6 prio 5 allot 1514 cell 8 maxburst 20 avpkt 1000 bounded
tc qdisc add dev eth0 parent 1:2 handle 2 sfq perturb 10
tc filter add dev eth0 parent 1:0 protocol ip prio 100 u32 match ip dst 192.168.0.2 classid 1:2

tc class add dev eth0 parent 1: classid 1:3 cbq bandwidth 10Mbit rate 64Kbit weight 6.4Kbit prio 5 allot 1514 cell 8 maxburst 20 avpkt 1000 bounded
tc qdisc add dev eth0 parent 1:3 handle e sfq perturb 10
tc filter add dev eth0 parent 1:0 protocol ip prio 100 u32 match ip src 192.168.0.2 classid 1:3
------------------------------

I don't know why a IP packet with src IP=192.168.0.2 is captured by a filter who says very clear that it will only takes packets where dst IP is 192.168.0.2

I'm using RedHat 7.3 with default kernel (2.4.18-13), another time, partner's restricctions, eth0 is the private side of the gateway.

Thanks in advance.

PD: Sorry about my broken english.

-- 
Fernando Sancho Glez-Calero
E.S. de Informática de Ciudad Real
Universidad de Castilla la Mancha
Profesor Asociado
Dpto. Arquitectura y Redes de Computadores.
Tlf: +34 926295300 ext:6216, 3705, 6217

Attachment: signature.asc
Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada digitalmente


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