From: Tomasz Paszkowski Date: Wed, 12 Jan 2005 13:11:21 +0000 Subject: Re: [LARTC] hashing filters Message-Id: <20050112131121.GA5641@krezus.e-wro.net> MIME-Version: 1 Content-Type: multipart/mixed; boundary="FL5UXtIhxfXey3p5" List-Id: References: In-Reply-To: To: lartc@vger.kernel.org --FL5UXtIhxfXey3p5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 12, 2005 at 01:27:18PM +0100, Valton Hashani wrote: > Hi all, > I am a newbie and I have not played a lot with tc utility. I have red may= be everything that has to do with massive filtering (maybe not everything).= If you can help me on this I would appriciate that very much. I use tc uti= lity with iproute2-ss040831.=20 > I want to limit bandwidth for the 192.168.0.0/16 subnet using this scri= pt. >=20 >=20 > tc qdisc del dev eth0 root > tc qdisc add dev eth0 root handle 1: htb > tc class add dev eth0 parent 1: classid 1:2 htb rate 100Mbit ceil 100MBi= t=20 > tc filter add dev eth0 parent 1:2 handle 2: protocol ip u32 divisor 256 > tc filter add dev eth0 protocol ip parent 1: u32 match ip dst 192.168.0.0= /16 hashkey mask 0x000000ff at 12 link 2: change to: tc filter add dev eth0 protocol ip parent 1: u32 match ip dst 192.168.0.0/2= 4 hashkey mask 0x000000ff at 16 link 2: > tc class add dev eth0 parent 1:2 classid 1:3 htb rate 128Kbit ceil 128Kb= it >=20 > j=3D0; >=20 > while [ $j -le 254 ] >=20 > do > i=3D0; >=20 > while [ $i -le 254 ] > do > hexi=3D`echo "obase=3D16; $i" | bc` add hiere: echo tc filter add dev eth0 protocol ip parent 1:2 u32 ht 2:$hexi: match = ip dst 192.168.$j.$i flowid 1:3 and show us results. > tc filter add dev eth0 protocol ip parent 1:2 u32 ht 2:$h= exi: match ip dst 192.168.$j.$i flowid 1:3 > i=3D$((i+1)) > done >=20 > j=3D$((j+1)) > done > =20 > somewhere at 192.168.8.7/32 it appears on the screen this message=20 >=20 > RTNETLINK answers: File exists > We have an error talking to the kernel >=20 > Can you tell me please what am I doing wrong. --=20 Tomasz Paszkowski --FL5UXtIhxfXey3p5 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFB5SH5cNXOL98XeysRAvG+AJ0fC7TCUZn1Ro7jixbv0yqxjIhthACeM+Q+ 2b8OEvvcJ96CzuyW79kPqFA= =BQcC -----END PGP SIGNATURE----- --FL5UXtIhxfXey3p5-- _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/