tc filter problems, please help...

Linux Advanced Routing and Traffic Control

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

 



Hi Guys,

I have a couple of problems that are driving me nuts.

This is the script I am using to setup restirctions and bw limitations:

#Adding root class.
tc qdisc add dev eth0 root handle 1: htb default 10 &>/dev/null
tc class add dev eth0 parent 1: classid 1:1 htb rate 100Mbit ceil 100Mbit burst 2k quantum 1536
tc qdisc add dev eth1 root handle 1: htb default 10 &>/dev/null
tc class add dev eth1 parent 1: classid 1:1 htb rate 100Mbit ceil 100Mbit burst 2k quantum 1536
# Checking for network cards
#DEVICE: eth0
tc class add dev eth0 parent 1:1 classid 1:10 htb rate 100Mbit ceil 100Mbit burst 12k prio 2 quantum 1536 tc filter add dev eth0 protocol ip parent 1:0 prio 1 handle 143 fw classid 1:0x10
tc qdisc add dev eth0 parent 1:0x10 handle 0x10: pfifo limit 5
tc class add dev eth0 parent 1:1 classid 1:20 htb rate 100Mbit ceil 100Mbit burst 12k prio 2 quantum 1536 tc filter add dev eth0 protocol ip parent 1:0 prio 1 handle 142 fw classid 1:0x20
tc qdisc add dev eth0 parent 1:0x20 handle 0x20: pfifo limit 5
#Selecting clients and restrictions
#Found 1 restrions
tc class add dev eth0 parent 1:10 classid 1:0x25 htb rate 2Mbit ceil 2Mbit burst 12k prio 2 quantum 1536
tc qdisc add dev eth0 parent 1:0x25 handle 0x25: pfifo limit 5
tc class add dev eth0 parent 1:20 classid 1:0x26 htb rate 256Kbit ceil 512Kbit burst 12k prio 2 quantum 1536
tc qdisc add dev eth0 parent 1:0x26 handle 0x26: pfifo limit 5
tc filter add dev eth0 protocol ip pref 10 parent 1:10 u32 match ip dst 192.168.0.2 classid 1:0x25 tc filter add dev eth0 protocol ip pref 10 parent 1:20 u32 match ip dst 192.168.0.2 classid 1:0x26
#DEVICE: eth1
tc class add dev eth1 parent 1:1 classid 1:10 htb rate 100Mbit ceil 100Mbit burst 12k prio 2 quantum 1536 tc filter add dev eth1 protocol ip parent 1:0 prio 1 handle 1443 fw classid 1:0x10
tc qdisc add dev eth1 parent 1:0x10 handle 0x10: pfifo limit 5
tc class add dev eth1 parent 1:1 classid 1:20 htb rate 100Mbit ceil 100Mbit burst 12k prio 2 quantum 1536 tc filter add dev eth1 protocol ip parent 1:0 prio 1 handle 1442 fw classid 1:0x20
tc qdisc add dev eth1 parent 1:0x20 handle 0x20: pfifo limit 5
#Selecting clients and restrictions
tc class add dev eth1 parent 1:10 classid 1:0x25 htb rate 2Mbit ceil 2Mbit burst 12k prio 2 quantum 1536
tc qdisc add dev eth1 parent 1:0x25 handle 0x25: pfifo limit 5
tc class add dev eth1 parent 1:20 classid 1:0x26 htb rate 128Kbit ceil 128Kbit burst 12k prio 2 quantum 1536
tc qdisc add dev eth1 parent 1:0x26 handle 0x26: pfifo limit 5
tc filter add dev eth1 protocol ip pref 10 parent 1:10 u32 match ip src 192.168.0.2 classid 1:0x25 tc filter add dev eth1 protocol ip pref 10 parent 1:20 u32 match ip src 192.168.0.2 classid 1:0x26


1. What is the precise syntax for deleting a tc filter? tc show gives me this output:

[root@thor htb]# tc filter show dev eth0 parent 1:20
filter protocol ip pref 10 u32
filter protocol ip pref 10 u32 fh 801: ht divisor 1
filter protocol ip pref 10 u32 fh 801::800 order 2048 key ht 801 bkt 0 flowid 1:26
 match c0a80002/ffffffff at 16
filter protocol ip pref 10 u32 fh 800: ht divisor 1
filter protocol ip pref 10 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:25
 match c0a80002/ffffffff at 16

How do I delete flowid 1:26 for example? Everything I tried returns an error message.

2. Am I right in assuming that filters created under class 1:10 should not be displayed when listing filters for class 1:20? Looking at the above tc show output, and this output:

[root@thor htb]# tc filter show dev eth0 parent 1:10
filter protocol ip pref 10 u32
filter protocol ip pref 10 u32 fh 801: ht divisor 1
filter protocol ip pref 10 u32 fh 801::800 order 2048 key ht 801 bkt 0 flowid 1:26
 match c0a80002/ffffffff at 16
filter protocol ip pref 10 u32 fh 800: ht divisor 1
filter protocol ip pref 10 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:25
 match c0a80002/ffffffff at 16

Why am I getting flowid 1:26 and 1:25 under classid 1:10 and 1:20? Am I doing something wrong, perhaps when creating the filters or classes? Or is the outout correct and I am worrying for nothing?

Any help would much appreciated, as I've spent a lot of time on this and have not found any answers anywhere.

Thank you and regards,
Michael.

_________________________________________________________________
The new MSN Search Toolbar now includes Desktop search! http://join.msn.com/toolbar/overview

_______________________________________________
LARTC mailing list
LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

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