Wątpliwości dotyczące htb
: 08 maja 2008, 16:24
Mam taki skrypt htb
mam łącze 8Mb i chciałbym przydzielić każdemu z userów max 512kbit czy wówczas ten skrypt jest odpowiednio napisany bo mam wrażenie że wszyscy klienci podpięci do kolejki 1:2 mają łącznie 512 a nie każdy z osobna ma max 512 czy moje obawy sa słuszne czy tylko mam takie wrażenie
Kod: Zaznacz cały
modprobe sch_htb
modprobe sch_sfq
modprobe cls_u32
tc qdisc del root dev eth1
tc qdisc add dev eth1 root handle 1:0 htb
tc class add dev eth1 parent 1:1 classid 1:2 htb rate 512kbit ceil 8000kbit
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst 192.168.1.20 flowid 1:2
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst 192.168.1.21 flowid 1:2
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst 192.168.1.22 flowid 1:2
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst 192.168.1.23 flowid 1:2
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst 192.168.1.24 flowid 1:2
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst 192.168.1.25 flowid 1:2
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst 192.168.1.26 flowid 1:2
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst 192.168.1.27 flowid 1:2
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst 192.168.1.28 flowid 1:2
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst 192.168.1.29 flowid 1:2
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst 192.168.1.30 flowid 1:2
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst 192.168.1.31 flowid 1:2
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst 192.168.1.32 flowid 1:2
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst 192.168.1.33 flowid 1:2
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst 192.168.1.34 flowid 1:2
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst 192.168.1.35 flowid 1:2
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst 192.168.1.36 flowid 1:2
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst 192.168.1.37 flowid 1:2
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst 192.168.1.38 flowid 1:2
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst 192.168.1.39 flowid 1:2
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst 192.168.1.40 flowid 1:2
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst 192.168.1.41 flowid 1:2
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst 192.168.1.42 flowid 1:2
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst 192.168.1.43 flowid 1:2
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst 192.168.1.44 flowid 1:2
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst 192.168.1.45 flowid 1:2
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst 192.168.1.46 flowid 1:2
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst 192.168.1.47 flowid 1:2
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst 192.168.1.48 flowid 1:2
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst 192.168.1.49 flowid 1:2
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst 192.168.1.50 flowid 1:2
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst 192.168.1.66 flowid 1:2
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst 192.168.1.99 flowid 1:2
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst 192.168.1.77 flowid 1:2
tc qdisc add dev eth1 parent 1:2 handle 2:0 sfq perturb 10
tc qdisc add dev eth1 parent 1:3 handle 3:0 sfq perturb 10
tc filter add dev eth1 parent 1:0 prio 2 protocol ip u32 match ip dport 80 0xffff flowid 1:2
tc filter add dev eth1 parent 1:0 prio 2 protocol ip u32 match ip dport 8080 0xffff flowid 1:2
tc filter add dev eth1 parent 1:0 prio 0 protocol ip u32 match ip dport 5060 0xffff flowid 1:2
tc filter add dev eth1 parent 1:0 prio 0 protocol ip u32 match ip dport 5061 0xffff flowid 1:2
tc filter add dev eth1 parent 1:0 prio 500 protocol ip u32 match ip dport 6346 0xffff flowid 1:2
tc filter add dev eth1 parent 1:0 prio 500 protocol ip u32 match ip dport 6348 0xffff flowid 1:2
tc filter add dev eth1 parent 1:0 prio 0 protocol ip u32 match ip dport 0 0xffff flowid 1:2
tc qdisc del root dev eth0
tc qdisc add dev eth0 root handle 1: prio
tc qdisc add dev eth0 parent 1:2 handle 20: tbf rate 256kbit buffer 1600 limit 3000