[LARTC] htb 10 mbit to my router. HELP

Linux Advanced Routing and Traffic Control

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

 



As u see i have 512 kbit connection to internet. i have devided internet 
speed to some classes. i want ot have 10 mbit to my linux which  is 
shaping traffic. is this good script for it? Please help me to sellect 
traffic to  my linux and put it to 10 mbit, and internet traffic put to 
512 kbit.
give me en examples by iptables.
###################################################################
tc qdisc del dev eth0 root
#eht0 rules
tc qdisc add dev eth0 root handle 1: htb default 11
#shape interface eth0
tc class add dev eth0 parent 1: classid 1:1 htb rate 10mbit ceil 10mbit
tc class add dev eth0 parent 1:1 classid 1:2 htb rate 500kbit ceil 10mbit
tc class add dev eth0 parent 1:2 classid 1:3 htb rate 500kbit ceil 
500kbit burst 2k
tc class add dev eth0 parent 1:3 classid 1:4 htb rate 12kbit ceil 
500kbit burst 2k
#voip class
tc class add dev eth0 parent 1:3 classid 1:12 htb rate 100kbit ceil 
512kbit burst 2k
tc class add dev eth0 parent 1:3 classid 1:14 htb rate 100kbit ceil 
512kbit burst 2k
tc class add dev eth0 parent 1:3 classid 1:16 htb rate 100kbit ceil 
512kbit burst 2k
tc class add dev eth0 parent 1:3 classid 1:18 htb rate 100kbit ceil 
512kbit burst 2k
tc class add dev eth0 parent 1:3 classid 1:20 htb rate 100kbit ceil 
512kbit burst 2k
#staff class
tc class add dev eth0 parent 1:4 classid 1:11 htb rate 4kbit ceil 
512kbit burst 2k
tc class add dev eth0 parent 1:4 classid 1:13 htb rate 4kbit ceil 
512kbit burst 2k
tc class add dev eth0 parent 1:4 classid 1:15 htb rate 4kbit ceil 
512kbit burst 2k
tc class add dev eth0 parent 1:4 classid 1:17 htb rate 4kbit ceil 
512kbit burst 2k
#mark voip class
tc filter add dev eth0 parent 1: protocol ip prio 3 handle 2 fw classid 1:12
tc filter add dev eth0 parent 1: protocol ip prio 3 handle 4 fw classid 1:14
tc filter add dev eth0 parent 1: protocol ip prio 3 handle 6 fw classid 1:16
tc filter add dev eth0 parent 1: protocol ip prio 3 handle 8 fw classid 1:18
tc filter add dev eth0 parent 1: protocol ip prio 3 handle 10 fw classid 
1:20
#mark staff class
tc filter add dev eth0 parent 1: protocol ip prio 3 handle 1 fw classid 1:11
tc filter add dev eth0 parent 1: protocol ip prio 3 handle 3 fw classid 1:13
tc filter add dev eth0 parent 1: protocol ip prio 3 handle 5 fw classid 1:15
tc filter add dev eth0 parent 1: protocol ip prio 3 handle 7 fw classid 1:17
#add qdisc discipline voip
tc qdisc add dev eth0 parent 1:12 handle 32: sfq perturb 10
tc qdisc add dev eth0 parent 1:14 handle 34: sfq perturb 10
tc qdisc add dev eth0 parent 1:16 handle 36: sfq perturb 10
tc qdisc add dev eth0 parent 1:18 handle 38: sfq perturb 10
tc qdisc add dev eth0 parent 1:20 handle 40: sfq perturb 10
#add qdisc discipline staff
tc qdisc add dev eth0 parent 1:11 handle 41: sfq perturb 10
tc qdisc add dev eth0 parent 1:13 handle 43: sfq perturb 10
tc qdisc add dev eth0 parent 1:15 handle 45: sfq perturb 10
tc qdisc add dev eth0 parent 1:17 handle 47: sfq perturb 10

example ip-s
linux router ip 192.168.0.100
voip class
1:12  = 192.168.0.1
1:14  = 192.168.0.2
1:16  = 192.168.0.3
1:18  = 192.168.0.4
1:20  = 192.168.0.5
staff class
1:11 = 192.168.0.6
1:13 = 192.168.0.7
1:15 = 192.168.0.8
1;17 = 192.168.0.9




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