Tc filter does not filter

Bjoern Meier <[email protected]>
Newsgroups gmane.linux.debian.devel.firewall
Message-ID <[email protected]>
Hi,

can anybody help me out? I wrote these little script (just for testing):

#!/bin/bash
# Name of the traffic control command.
TC=/sbin/tc

# The network interface we're planning on limiting bandwidth.
IF=eth5             # Interface

# Download limit (in mega bits)
LIMIT=500kbps          # DOWNLOAD Limit

# Filter options for limiting the intended interface.
U32="$TC filter add dev $IF protocol ip parent 1:0 prio 1 u32"


# delete any current qdisc -- in and out
$TC qdisc del dev eth5 root    2> /dev/null > /dev/null
$TC qdisc del dev eth5 ingress 2> /dev/null > /dev/null

$TC qdisc add dev $IF root handle 1: htb default 30
$TC class add dev $IF parent 1: classid 1:1 htb rate $LIMIT
$U32 match ip dport 22 0xffff flowid 1:1
$U32 match ip dport 22 0xffff flowid 1:1

But it does not work.


"tc -s filter ls dev eth5" shows me :

filter parent 1: protocol ip pref 1 u32
filter parent 1: protocol ip pref 1 u32 fh 800: ht divisor 1
filter parent 1: protocol ip pref 1 u32 fh 800::800 order 2048 key ht
800 bkt 0 flowid 1:1  (rule hit 21750 success 0)
  match 00000016/0000ffff at 20 (success 0 )
filter parent 1: protocol ip pref 1 u32 fh 800::801 order 2049 key ht
800 bkt 0 flowid 1:1  (rule hit 21750 success 0)
  match 00000016/0000ffff at 20 (success 0 )


seems the rule hit the pakages, but there is no limit.

Some tipps for me?

Greetings,
Björn
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.