[LARTC] Question on TC filter

Linux Advanced Routing and Traffic Control

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

 



Hi,

I want work out a GUI interface for htb and now here
comes to the part about adding and removing classes
and filters.

Here is an example script.
TC="tc"
DEV="dev eth1"

echo "Add root qdisc, default traffic go to 1:30"
$TC qdisc add $DEV root handle 1: htb default 30

echo "Divide the traffic into different classes and
levels"
# -------- level 1 --------
$TC class add $DEV parent 1: classid 1:1 htb rate
100mbit burst 15k
# -------- level 2 --------
$TC class add $DEV parent 1:1 classid 1:10 htb rate
400kbit ceil 600kbit burst 10m
$TC class add $DEV parent 1:1 classid 1:20 htb rate
1mbit ceil 1.5mbit burst 1m

echo "SFQ for beneath these classes:"
$TC qdisc add $DEV parent 1:10 handle 10: sfq perturb
10
$TC qdisc add $DEV parent 1:20 handle 20: sfq perturb
10

echo "Add the filters which direct traffic to the
right classes:"
tc filter add $DEV parent 1: protocol ip u32 match ip
dst 192.168.0.2/32 flowid 1:10
tc filter add $DEV parent 1: protocol ip u32 match ip
dst 192.168.0.3/32 flowid 1:20

Suppose I want to remove the class 1:20. What should I
do? I need to first remove the filters with flowid
1:20, but how can I remove it independently???
If I run "tc filter del $DEV parent 1:0......", then
all filters will be removed. Any suggestion on how to
solve this problem or a better way to organise the
classes or filters??

Thanks in advance,
William

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com


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