[LARTC] htb+tc. traffic shape problem. i am shaping to 128kbps but i candownload with more speed.

Linux Advanced Routing and Traffic Control

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

 



I have 2 net cards in my router. eth1 and eth0. eth0 is internal eth1 is 
external (connected to internet).

tc qdisc del dev eth0 root
tc qdisc del dev eth1 root
#eht0
tc qdisc add dev eth0 root handle 1: htb default 10
tc class add dev eth0 parent 1: classid 1:1 htb rate 128kbps ceil 
128kbps burst 2k
tc class add dev eth0 parent 1:1 classid 1:10 htb rate 128kbps ceil 
128kbps burst 2k
tc class add dev eth0 parent 1:1 classid 1:11 htb rate 1kbps ceil 
128kbps burst 2k

tc filter add dev eth0 parent 1: protocol ip prio 3 handle 2 fw classid 1:10
tc filter add dev eth0 parent 1: protocol ip prio 3 handle 1 fw classid 1:11

#eth1
tc qdisc add dev eth1 root handle 1: htb default 10
tc class add dev eth1 parent 1: classid 1:1 htb rate 128kbps ceil 
128kbps burst 2k
tc class add dev eth1 parent 1:1 classid 1:10 htb rate 128kbps ceil 
128kbps burst 2k
tc class add dev eth1 parent 1:1 classid 1:11 htb rate 1kbps ceil 
128kbps burst 2k

tc filter add dev eth1 parent 1: protocol ip prio 3 handle 4 fw classid 1:10
tc filter add dev eth1 parent 1: protocol ip prio 3 handle 3 fw classid 1:11

#iptables output
iptables -F -t mangle
#staff ips
iptables -A OUTPUT -t mangle -p tcp -d 200.200.200.1 -j MARK --set-mark 1
#priorized ip-s
iptables -A OUTPUT -t mangle -p tcp -d 200.200.200.2 -j MARK --set-mark 2

#iptables prerouting
#staff ip-s
iptables -A PREROUTING -t mangle -s 200.200.200.1  -j MARK --set-mark 3
#priorized ip-s
iptables -A PREROUTING -t mangle -s 200.200.200.2  -j MARK --set-mark 4

this is my skript.

in 128 kbps i can download maxiimum with 15-1, but i am download with 
100 and more. why?





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