Nie jesteś zalogowany.
Jeśli nie posiadasz konta, zarejestruj je już teraz! Pozwoli Ci ono w pełni korzystać z naszego serwisu. Spamerom dziękujemy!
Prosimy o pomoc dla małej Julki — przekaż 1% podatku na Fundacji Dzieciom zdazyć z Pomocą.
Więcej informacji na dug.net.pl/pomagamy/.

Użytkownik


Znalazłem taki sktyprt na http://www.v-smart.pl/routery-linuxowe/linux-router … yzacja-ruchu/
#!/bin/bash
TC=/sciezka/do/tc (sprawdz which tc)
superhtb(){
# procentowy podzial uslug (suma daje 100 ;)
sygnalizacja=10
interaktywne=20
standardowe=40
poczta=10
lowprio=10
inne=5
p2p=5
# kolejka glowna
$TC qdisc add dev ${1} root handle 1:0 htb default 8
$TC class add dev ${1} parent 1:0 classid 1:1 htb rate ${4}kbit
# klasy uslug
$TC class add dev ${1} parent 1:1 classid 1:2 htb rate $((${4}*${sygnalizacja}/100))kbit ceil ${4}kbit prio 2
$TC class add dev ${1} parent 1:1 classid 1:3 htb rate $((${4}*${interaktywne}/100))kbit ceil ${4}kbit prio 3
$TC class add dev ${1} parent 1:1 classid 1:5 htb rate $((${4}*${standardowe}/100))kbit ceil ${4}kbit prio 5
$TC class add dev ${1} parent 1:1 classid 1:6 htb rate $((${4}*${poczta}/100))kbit ceil ${4}kbit prio 6
$TC class add dev ${1} parent 1:1 classid 1:7 htb rate $((${4}*${lowprio}/100))kbit ceil $((${4}*70/100))kbit prio 7
$TC class add dev ${1} parent 1:1 classid 1:8 htb rate $((${4}*${inne}/100))kbit ceil $((${4}*50/100))kbit prio 8
$TC class add dev ${1} parent 1:1 classid 1:9 htb rate $((${4}*${p2p}/100))kbit ceil $((${4}*50/100))kbit prio 9
# filtry - sygnalizacja - ack, icmp, dns, sip, mark 2
$TC filter add dev ${1} protocol ip parent 1:0 prio 1 u32 match ip protocol 6 0xff match u8 0x05 0x0f at 0 match u16 0x0000 0xffc0 at 2 match u8 0x10 0xff a$
$TC filter add dev ${1} protocol ip parent 1:0 u32 match ip protocol 1 0xff flowid 1:2
$TC filter add dev ${1} protocol ip parent 1:0 u32 match ip ${2} 53 0xffff flowid 1:2
$TC filter add dev ${1} protocol ip parent 1:0 u32 match ip ${2} 21 0xffff flowid 1:2
$TC filter add dev ${1} protocol ip parent 1:0 u32 match ip ${2} 5060 0xffff flowid 1:2
# filtry - uslugi interaktywne - ssh, voip, gry, mark 4
$TC filter add dev ${1} protocol ip parent 1:0 u32 match ip ${2} 22 0xffff flowid 1:3
$TC filter add dev ${1} protocol ip parent 1:0 handle 4 fw flowid 1:3
# filtry - uslugi standardowe - http, https, vpn, dude
$TC filter add dev ${1} protocol ip parent 1:0 u32 match ip ${2} 80 0xffff flowid 1:5
$TC filter add dev ${1} protocol ip parent 1:0 u32 match ip ${2} 443 0xffff flowid 1:5
$TC filter add dev ${1} protocol ip parent 1:0 u32 match ip ${2} 1723 0xffff flowid 1:5
$TC filter add dev ${1} protocol ip parent 1:0 u32 match ip protocol 47 0xff flowid 1:5
$TC filter add dev ${1} protocol ip parent 1:0 u32 match ip protocol 50 0xff flowid 1:5
$TC filter add dev ${1} protocol ip parent 1:0 u32 match ip protocol 51 0xff flowid 1:5
$TC filter add dev ${1} protocol ip parent 1:0 u32 match ip ${2} 2210 0xffff flowid 1:5
# filtry - poczta - pop3, pop3s, smtp, smtps, pop3s, imap
$TC filter add dev ${1} protocol ip parent 1:0 u32 match ip ${2} 25 0xffff flowid 1:6
$TC filter add dev ${1} protocol ip parent 1:0 u32 match ip ${2} 110 0xffff flowid 1:6
$TC filter add dev ${1} protocol ip parent 1:0 u32 match ip ${2} 465 0xffff flowid 1:6
$TC filter add dev ${1} protocol ip parent 1:0 u32 match ip ${2} 995 0xffff flowid 1:6
$TC filter add dev ${1} protocol ip parent 1:0 u32 match ip ${2} 143 0xffff flowid 1:6
# filtry - lowprio - ftp data, http-video, mark 7
$TC filter add dev ${1} protocol ip parent 1:0 u32 match ip ${2} 20 0xffff flowid 1:7
$TC filter add dev ${1} protocol ip parent 1:0 handle 7 fw flowid 1:7
# filtry - p2p, mark 9
$TC filter add dev ${1} protocol ip parent 1:0 handle 9 fw flowid 1:9
# mechanizm ESFQ - ciecie pasma per ip
$TC qdisc add dev ${1} parent 1:2 handle 2: sfq perturb 10 hash ${3}
$TC qdisc add dev ${1} parent 1:3 handle 3: sfq perturb 10 hash ${3}
$TC qdisc add dev ${1} parent 1:4 handle 4: sfq perturb 10 hash ${3}
$TC qdisc add dev ${1} parent 1:5 handle 5: sfq perturb 10 hash ${3}
$TC qdisc add dev ${1} parent 1:6 handle 6: sfq perturb 10 hash ${3}
$TC qdisc add dev ${1} parent 1:7 handle 7: sfq perturb 10 hash ${3}
$TC qdisc add dev ${1} parent 1:8 handle 8: sfq perturb 10 hash ${3}
$TC qdisc add dev ${1} parent 1:9 handle 9: sfq perturb 10 hash ${3}
}
# czyszczenie kolejek
$TC qdisc del root dev imq0 2> /dev/null > /dev/null
$TC qdisc del root dev eth0 2> /dev/null > /dev/null
# odpalenie ograniczen
superhtb imq0 sport ctorigdst DOWNLOAD_kbps
suberhtb eth0 dport ctorigsrc UPLOAD_kbpsale nie rozumiem jak zdefinować zmienne ${1} ${2} ${3} ${4} i DOWNLOAD_kbps i UPLOAD_kbps
Offline


Członek DUG