może sobie poradziłeś już z tym tematem sam, =
ale widziałem że nie było
odpowiedzi na grupie więc piszę:
Poniżej działający skrypt dla prędkości =
wejściowej 1Mbps (zawsze wyciągam
troszkę więcej :))
Zwróć uwagę na "preference 1 i preference =
2 w filtrach, prawdopodobnie
dlatego nie wpadało ci do klasy dla ruchu =
lokalnego.
Możesz też zrobić skrypt który będzie =
filtrował po określonych usługach (
np. www, poczta i inne) Ja tak robię w dzień, w =
nocy włączam ten ponizszy
skrypt i jest sprawiedliwie. Jak masz jakieś =
pytania, albo własne wyczyny w
temacie HTB to wal na priva xtc@lancaster.one.pl , a =
jak będzie coś
ciekawego to się pośle na grupę.
#czyszczenie tablicy
tc qdisc del root dev eth0
#dodanie kolejki głównej
tc qdisc add dev eth0 root handle 100:0 htb
#dodaję klasę główną
tc class add dev eth0 parent 100:0 classid 100:1 htb =
rate 99000kbit ceil
99000kbit
#przydział całego pasma
tc class add dev eth0 parent 100:1 classid 100:2 htb =
rate 1100kbit ceil
1100kbit
tc class add dev eth0 parent 100:1 classid 100:3 htb =
rate 97000kbit ceil
97000kbit
#podział na userów
tc class add dev eth0 parent 100:2 classid 100:4 htb =
rate 40kbit ceil
1100kbit
tc class add dev eth0 parent 100:2 classid 100:5 htb =
rate 40kbit ceil
1100kbit
tc class add dev eth0 parent 100:2 classid 100:6 htb =
rate 40kbit ceil
1100kbit
tc class add dev eth0 parent 100:2 classid 100:7 htb =
rate 40kbit ceil
110kbit
tc class add dev eth0 parent 100:2 classid 100:8 htb =
rate 40kbit ceil
1100kbit
tc class add dev eth0 parent 100:2 classid 100:9 htb =
rate 40kbit ceil
1100kbit
tc class add dev eth0 parent 100:2 classid 100:10 htb =
rate 40kbit ceil
1100kbit
tc class add dev eth0 parent 100:2 classid 100:11 htb =
rate 40kbit ceil
1100kbit
tc class add dev eth0 parent 100:2 classid 100:12 htb =
rate 40kbit ceil
1100kbit
tc class add dev eth0 parent 100:2 classid 100:13 htb =
rate 40kbit ceil
1100kbit
tc class add dev eth0 parent 100:2 classid 100:14 htb =
rate 40kbit ceil
1100kbit
tc class add dev eth0 parent 100:2 classid 100:15 htb =
rate 40kbit ceil
1100kbit
tc class add dev eth0 parent 100:2 classid 100:16 htb =
rate 40kbit ceil
1100kbit
tc class add dev eth0 parent 100:2 classid 100:17 htb =
rate 40kbit ceil
1100kbit
tc class add dev eth0 parent 100:2 classid 100:18 htb =
rate 40kbit ceil
1100kbit
tc class add dev eth0 parent 100:2 classid 100:19 htb =
rate 40kbit ceil
1100kbit
tc class add dev eth0 parent 100:2 classid 100:20 htb =
rate 40kbit ceil
1100kbit
tc class add dev eth0 parent 100:2 classid 100:21 htb =
rate 40kbit ceil
1100kbit
tc class add dev eth0 parent 100:2 classid 100:22 htb =
rate 40kbit ceil
1100kbit
tc class add dev eth0 parent 100:2 classid 100:23 htb =
rate 40kbit ceil
1100kbit
tc class add dev eth0 parent 100:2 classid 100:24 htb =
rate 40kbit ceil
1100kbit
tc class add dev eth0 parent 100:2 classid 100:25 htb =
rate 40kbit ceil
1100kbit
tc class add dev eth0 parent 100:2 classid 100:26 htb =
rate 40kbit ceil
1100kbit
tc class add dev eth0 parent 100:2 classid 100:27 htb =
rate 40kbit ceil
1100kbit
tc class add dev eth0 parent 100:2 classid 100:28 htb =
rate 40kbit ceil
1100kbit
tc class add dev eth0 parent 100:2 classid 100:29 htb =
rate 40kbit ceil
1100kbit
tc class add dev eth0 parent 100:2 classid 100:17 htb =
rate 40kbit ceil
1100kbit
tc class add dev eth0 parent 100:2 classid 100:18 htb =
rate 40kbit ceil
1100kbit
tc class add dev eth0 parent 100:2 classid 100:19 htb =
rate 40kbit ceil
1100kbit
tc class add dev eth0 parent 100:2 classid 100:20 htb =
rate 40kbit ceil
1100kbit
tc class add dev eth0 parent 100:2 classid 100:21 htb =
rate 40kbit ceil
1100kbit
tc class add dev eth0 parent 100:2 classid 100:22 htb =
rate 40kbit ceil
1100kbit
tc class add dev eth0 parent 100:2 classid 100:23 htb =
rate 40kbit ceil
1100kbit
tc class add dev eth0 parent 100:2 classid 100:24 htb =
rate 40kbit ceil
1100kbit
tc class add dev eth0 parent 100:2 classid 100:25 htb =
rate 40kbit ceil
1100kbit
tc class add dev eth0 parent 100:2 classid 100:26 htb =
rate 40kbit ceil
1100kbit
tc class add dev eth0 parent 100:2 classid 100:27 htb =
rate 40kbit ceil
1100kbit
tc class add dev eth0 parent 100:2 classid 100:28 htb =
rate 40kbit ceil
1100kbit
tc class add dev eth0 parent 100:2 classid 100:29 htb =
rate 40kbit ceil
1100kbit
#
#
#filtry
tc filter add dev eth0 protocol ip preference 1 =
parent 100:0 u32 match ip
src 192.168.1.1 flowid 100:3
###moje owieczki
tc filter add dev eth0 protocol ip preference 2 =
parent 100:0 u32 match ip
dst 192.168.1.3 flowid 100:4
tc filter add dev eth0 protocol ip preference 2 =
parent 100:0 u32 match ip
dst 192.168.1.4 flowid 100:5
tc filter add dev eth0 protocol ip preference 2 =
parent 100:0 u32 match ip
dst 192.168.1.5 flowid 100:6
tc filter add dev eth0 protocol ip preference 2 =
parent 100:0 u32 match ip
dst 192.168.1.6 flowid 100:7
tc filter add dev eth0 protocol ip preference 2 =
parent 100:0 u32 match ip
dst 192.168.1.7 flowid 100:8
tc filter add dev eth0 protocol ip preference 2 =
parent 100:0 u32 match ip
dst 192.168.1.8 flowid 100:9
tc filter add dev eth0 protocol ip preference 2 =
parent 100:0 u32 match ip
dst 192.168.1.9 flowid 100:10
tc filter add dev eth0 protocol ip preference 2 =
parent 100:0 u32 match ip
dst 192.168.1.10 flowid 100:11
tc filter add dev eth0 protocol ip preference 2 =
parent 100:0 u32 match ip
dst 192.168.1.11 flowid 100:12
tc filter add dev eth0 protocol ip preference 2 =
parent 100:0 u32 match ip
dst 192.168.1.12 flowid 100:13
tc filter add dev eth0 protocol ip preference 2 =
parent 100:0 u32 match ip
dst 192.168.1.15 flowid 100:14
tc filter add dev eth0 protocol ip preference 2 =
parent 100:0 u32 match ip
dst 192.168.1.18 flowid 100:15
tc filter add dev eth0 protocol ip preference 2 =
parent 100:0 u32 match ip
dst 192.168.1.19 flowid 100:16
tc filter add dev eth0 protocol ip preference 2 =
parent 100:0 u32 match ip
dst 192.168.1.20 flowid 100:17
tc filter add dev eth0 protocol ip preference 2 =
parent 100:0 u32 match ip
dst 192.168.1.21 flowid 100:18
tc filter add dev eth0 protocol ip preference 2 =
parent 100:0 u32 match ip
dst 192.168.1.22 flowid 100:19
tc filter add dev eth0 protocol ip preference 2 =
parent 100:0 u32 match ip
dst 192.168.1.25 flowid 100:20
tc filter add dev eth0 protocol ip preference 2 =
parent 100:0 u32 match ip
dst 192.168.1.26 flowid 100:21
tc filter add dev eth0 protocol ip preference 2 =
parent 100:0 u32 match ip
dst 192.168.1.27 flowid 100:22
tc filter add dev eth0 protocol ip preference 2 =
parent 100:0 u32 match ip
dst 192.168.1.28 flowid 100:23
tc filter add dev eth0 protocol ip preference 2 =
parent 100:0 u32 match ip
dst 192.168.1.29 flowid 100:24
tc filter add dev eth0 protocol ip preference 2 =
parent 100:0 u32 match ip
dst 192.168.1.31 flowid 100:25
tc filter add dev eth0 protocol ip preference 2 =
parent 100:0 u32 match ip
dst 192.168.1.32 flowid 100:26
tc filter add dev eth0 protocol ip preference 2 =
parent 100:0 u32 match ip
dst 192.168.1.33 flowid 100:27
tc filter add dev eth0 protocol ip preference 2 =
parent 100:0 u32 match ip
dst 192.168.1.34 flowid 100:28
tc filter add dev eth0 protocol ip preference 2 =
parent 100:0 u32 match ip
dst 192.168.1.35 flowid 100:29
#
#
#podział po równo
tc qdisc add dev eth0 parent 100:3 handle 300:0 sfq =
perturb 10
#
tc qdisc add dev eth0 parent 100:4 handle 403:0 sfq =
perturb 10
tc qdisc add dev eth0 parent 100:5 handle 404:0 sfq =
perturb 10
tc qdisc add dev eth0 parent 100:6 handle 405:0 sfq =
perturb 10
tc qdisc add dev eth0 parent 100:7 handle 406:0 sfq =
perturb 10
tc qdisc add dev eth0 parent 100:8 handle 407:0 sfq =
perturb 10
tc qdisc add dev eth0 parent 100:9 handle 408:0 sfq =
perturb 10
tc qdisc add dev eth0 parent 100:10 handle 409:0 sfq =
perturb 10
tc qdisc add dev eth0 parent 100:11 handle 410:0 sfq =
perturb 10
tc qdisc add dev eth0 parent 100:12 handle 411:0 sfq =
perturb 10
tc qdisc add dev eth0 parent 100:13 handle 412:0 sfq =
perturb 10
tc qdisc add dev eth0 parent 100:14 handle 415:0 sfq =
perturb 10
tc qdisc add dev eth0 parent 100:15 handle 418:0 sfq =
perturb 10
tc qdisc add dev eth0 parent 100:16 handle 419:0 sfq =
perturb 10
tc qdisc add dev eth0 parent 100:17 handle 420:0 sfq =
perturb 10
tc qdisc add dev eth0 parent 100:18 handle 421:0 sfq =
perturb 10
tc qdisc add dev eth0 parent 100:19 handle 422:0 sfq =
perturb 10
tc qdisc add dev eth0 parent 100:20 handle 425:0 sfq =
perturb 10
tc qdisc add dev eth0 parent 100:21 handle 426:0 sfq =
perturb 10
tc qdisc add dev eth0 parent 100:22 handle 427:0 sfq =
perturb 10
tc qdisc add dev eth0 parent 100:23 handle 428:0 sfq =
perturb 10
tc qdisc add dev eth0 parent 100:24 handle 429:0 sfq =
perturb 10
tc qdisc add dev eth0 parent 100:25 handle 431:0 sfq =
perturb 10
tc qdisc add dev eth0 parent 100:26 handle 432:0 sfq =
perturb 10
tc qdisc add dev eth0 parent 100:27 handle 433:0 sfq =
perturb 10
tc qdisc add dev eth0 parent 100:28 handle 434:0 sfq =
perturb 10
tc qdisc add dev eth0 parent 100:29 handle 435:0 sfq =
perturb 10
#
#koniec bajki