From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fernando Sancho Date: Fri, 19 Dec 2003 11:40:30 +0000 Subject: [LARTC] shapping over the same interface MIME-Version: 1 Content-Type: multipart/mixed; boundary="=-FvxujcgF3U8hiztu3KgL" Message-Id: List-Id: To: lartc@vger.kernel.org --=-FvxujcgF3U8hiztu3KgL Content-Type: multipart/alternative; boundary="=-SDpZlux8SIkJYj9sr7kO" --=-SDpZlux8SIkJYj9sr7kO Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable 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=3Deth0,10Mbit,1Mbit RULE=3D,192.168.0.2 BOUNDED=3Dyes PRIO=3D5 RATE=3D256Kbit WEIGHT=3D25.6Kbit LEAF=3Dsfq #cbq-0003-outgoing-192.168.0.2 DEVICE=3Deth0,10Mbit,1Mbit RULE=3D192.168.0.2, BOUNDED=3Dyes PRIO=3D5 RATE=3D64Kbit WEIGHT=3D6.4Kbit LEAF=3Dsfq 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=20 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=3D192.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. --=20 Fernando Sancho Glez-Calero E.S. de Inform=E1tica de Ciudad Real Universidad de Castilla la Mancha Profesor Asociado Dpto. Arquitectura y Redes de Computadores. Tlf: +34 926295300 ext:6216, 3705, 6217 --=-SDpZlux8SIkJYj9sr7kO Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 restr= ictions). Well, according to cbq.init documentation i have to define two cl= asses for every IP

#cbq-0002-incoming-192.168.0.2
DEVICE=3Deth0,10Mbit,1Mbit
RULE=3D,192.168.0.2
BOUNDED=3Dyes
PRIO=3D5
RATE=3D256Kbit
WEIGHT=3D25.6Kbit
LEAF=3Dsfq

#cbq-0003-outgoing-192.168.0.2
DEVICE=3Deth0,10Mbit,1Mbit
RULE=3D192.168.0.2,
BOUNDED=3Dyes
PRIO=3D5
RATE=3D64Kbit
WEIGHT=3D6.4Kbit
LEAF=3Dsfq

The behavior of this es very extrange because all traffic from and to 192.1= 68.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<= BR> 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 256Kb= it 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 64Kbi= t 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=3D192.168.0.2 is captured by a fil= ter 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.

--=20
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
--=-SDpZlux8SIkJYj9sr7kO-- --=-FvxujcgF3U8hiztu3KgL Content-Type: application/pgp-signature; name=signature.asc Content-Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada digitalmente -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQA/4uOs0+VmUftoNOARAtirAJsFin18w7h8m6uiK2FI4N5joyBIMQCdFEAG PSdIISWLqbhacjxT5I//nCQ= =cDRN -----END PGP SIGNATURE----- --=-FvxujcgF3U8hiztu3KgL-- _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/