Re: [LARTC] How to do ensure bandwith

Linux Advanced Routing and Traffic Control

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

 



> yes.blew my scripts.
> tc qdisc del dev eth0 root
> tc qdisc add dev eth0 root handle 20: htb default 20
> tc class add dev eth0 parent 20: classid 20:1 htb rate 10240kbps ceil
> 10240kbps tc class add dev eth0 parent 20:1 classid 20:20 htb rate 2048kbps
> ceil 2048kbps tc qdisc add dev eth0 parent 20:20 sfq
> tc class add dev eth0 parent 20:1 classid 20:21 htb rate 2048kbps ceil
> 2048kbps tc qdisc add dev eth0 parent 20:21 sfq
> tc class add dev eth0 parent 20:1 classid 20:22 htb rate 2048kbps ceil
> 2048kbps tc qdisc add dev eth0 parent 20:22 sfq
> tc class add dev eth0 parent 20:1 classid 20:23 htb rate 2048kbps ceil
> 2048kbps tc qdisc add dev eth0 parent 20:23 sfq
> tc class add dev eth0 parent 20:1 classid 20:24 htb rate 2048kbps ceil
> 2048kbps tc qdisc add dev eth0 parent 20:24 sfq
> tc filter add dev eth0 parent 20: protocol ip  handle 1 fw classid  20:20
> tc filter add dev eth0 parent 20: protocol ip  handle 2 fw classid  20:21
> tc filter add dev eth0 parent 20: protocol ip  handle 3 fw classid  20:22
> tc filter add dev eth0 parent 20: protocol ip  handle 4 fw classid  20:23
> tc filter add dev eth0 parent 20: protocol ip  handle 5 fw classid  20:24
>
> iptables -t mangle -A FORWARD -p tcp -o eth0 -s 0/0 --dport 80 -d 0/0 -j
> MARK --set-mark 3 iptables -t mangle -A PREROUTING -p tcp -i eth0 -s 0/0
> --dport 80 -d 0/0 -j MARK --set-mark 3
Your script seems ok to me.

> >You can check with iptables -L -v -n if your iptables rules are matched. 
> > If the iptables rule match, the byte and packet counters will increase.
>
> when I use iptable -L -v -n -t mangle,I have below infor
> PREROUTING chain:
>  pkts bytes target     prot opt in     out     source              
> destination 305 40889  MARK       tcp  --  eth0   *       0.0.0.0/0        
>    0.0.0.0/0          tcp dpt:80 MARK set 0x3 FORWARD chain:
>  pkts bytes target     prot opt in     out     source              
> destination 0     0    MARK       tcp  --  *      eth0    0.0.0.0/0        
>    0.0.0.0/0          tcp dpt:80 MARK set 0x3
So the packets get marked.

> why not stream through ForWard chain ? beacause this all traffic into
> 20:20(default class)?

I suppose you execute
tc -s -d class show dev eth0
to see the counters increase for the 20:20 class and not for the other class?  
If you didn't execute that command before, can you do so and check the 
counters for the different classes?

Stef

-- 

stef.coene@xxxxxxxxx
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.oftc.net


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