jablonka.czprosek.czf

qos

Subversion Repositories:
[/] [trunk/] [qos] - Blame information for rev 44

 

Line No. Rev Author Line
12simandl#!/bin/sh
2#
3# CZFree.Net RFC-QoS script
4#
526simandl# date: 30/06/2008
628simandl# authors: Rakerihoo, Fyzik, Libor, Dzus, Bonez, Simandl, Danny, Sinda
72simandl# references: http://www.lartc.org/
8# http://luxik.cdi.cz/~devik/qos/htb/
928simandl# http://connected.prosek.czf/forum/showthread.php?s=&threadid=9
1013simandl# http://www.simandl.cz/stranky/linux/qos/soubory/qos_base
114simandl# version: 2.1.6
1229simandl# ps ver : 0.1.9
132simandl#
14# Changelog
15#
1644simandl# 11/02/09 [simandl] za provoz na 802.cz povazovano vse v subnetu 212.71.146.128/26
17# 10/02/09 [simandl] doplnena podpora pro Cisco VPN
1841simandl# 09/02/09 [sinda] doplnena podpora pro Call of Duty 4 (na PS3) - UDP: 3074, 3075, 3080
1940sinda# 02/02/09 [sinda] doplnena podpora pro nntps a vnc do tridy 40 (data transfer)
2039simandl# 25/01/09 [simandl] doplnena podpora pro svn port 3690
2138simandl# 14/01/09 [sinda] doplnena podpora pro hru "Sniper Elite" porty UDP 21540 a 54468
22# 13/01/09 [sinda] doplnena podpora pro RTP dle ip operatora systinet.com a rozsireni portu OpenVPN o 1194/UDP
2337simandl# 07/01/09 [simandl] doplnena podpora pro hru "World Of Warcraft" porty 6112 a 6881-6999
2434simandl# 23/12/08 [simandl] podpora pro ventrilo
2531simandl# 04/12/08 [sinda] doplnena podpora pro RTP dle ip operatoru fayn.cz, mujtelefon.cz, netphone.cz, aps.sbohempevnalinko.cz, fax.sipcz.net
2632simandl# 01/12/08 [sinda] File download over http do class airfree (TERASPACE-GMBH, yandex.ru, ...)
2730simandl# 04/11/08 [simandl] podpora pro hry "Battlefield" a "Call of Duty"
2829simandl# 13/10/08 [simandl] podpora pro hru "Warhammer Online"
2928simandl# 28/09/08 [simandl] doplneni chybejicich autoru a zmena v references 10.24.1.2 na connected.prosek.czf
3027simandl# 05/08/08 [simandl] podpora pro Americas Army
3126simandl# 30/06/08 [simandl] podpora pro L2TP port 1701 UDP
3225simandl# 09/03/08 [simandl] podpora pro noncontrib
3323simandl# 01/12/07 [simandl] doplnena podpora pro hru "World Of Warcraft" 8085 3724
3419simandl# 09/08/07 [sinda] doplnena podpora pro hru "Counter-Strike Source" UDP 270xx
3518simandl# 26/07/07 [sinda] doplnena podpora pro RTP ha-vel.cz a 802.cz dle ip adresy rtp serveru operatora
3615simandl# 31/08/06 [simandl] doplnena podpora pro definici rychlosti a delitelu pro kazdy iface zvlast v souboru iface_conf
3714simandl# 14/07/06 [sinda] doplneny porty pro hru Quake 3 arena
3813simandl# 17/01/06 [simandl] doplneny TOSy pro ha-vel a hlas.802.cz do VoIP tridy 50
39# 12/12/05 [simandl] preskupeny protokoly trid - 40 mail&data 50 voip 60 web&squid - tak aby byly rovnomerne vyuzite
4010simandl# 23/11/05 [simandl] doplneny porty pro Lineage2 a Teamspeak
419simandl# 22/11/05 [danny] DSCP/ToS filtry pro SIP/RTP (VoIP), maximum reliability [DEV]
428simandl# 20/11/05 [simandl] doplnen port pro RTP
436simandl# 14/11/05 [simandl] doplneny porty pro SIP a gnomemeeting
445simandl# 08/11/05 [simandl] doplneny porty pro H.323
45# 19/08/05 [simandl] doplneny porty pro hru DarkEden
464simandl# 30/10/04 [dzus] oprava parseru MTU, vylepseni kontroly konfig. souboru
47# 27/10/04 [bonez] OpenVPN pridano do data transfer class
48# 05/06/04 [dzus] do interactive class pridan BZFlag, uprava parseru konfig souboru
492simandl# 18/02/04 [dzus] SCP zarazeno do download class (rozliseno podle TOS maximize throughput)
50# 04/01/04 [dzus] podpora pro Jedi Knight, oprava prio u filtru, oprava filtru na FTP, zruseni PPTP class
51# 20/11/03 [dzus] zrusena H323 class, pridan filtr na TCP ACK, nastaveni quantum podle MTU
52# 28/09/03 [dzus] oprava bugu ve filtrech (bez prio to nechodi dobre)
53# 27/09/03 [dzus] konfigurace interfacu se nacita z ext souboru, pridan TOS minimize delay filtr
54# 20/09/03 [dzus] vyhazeni marku z IPtables, nyni pouze filtry v tc
55# 01/09/03 [dzus] vynechani internetoveho rozhrani z konfigurace
56# 07/08/03 [fyzik] preference Inetoveho traffiku
57# 31/07/03 [fyzik] podpora pro HL@tchor, airfree, fixes
58# 05/05/03 [fyzik] podpora pro IRC, PPTP, H323, LDAP, DC, NTP
59# 04/05/03 [fyzik] napsal uvod
60# 01/05/03 [fyzik] non-CZF-RFC, inspirovan Liborovym Heaven QoS
61# 00/03/03 [Rakerihoo] napsal RFC-QoS :)
62#
63# ToDo
64# * zkusit a otestovat podtridy CZF-transfer, CZF-klient, CZF-shared a markovanat podle MAC
65# * pridat podporu ostatnich interaktivnich games
66 
67 
68### Configuration START
69 
7021simandlIFACECONFFILE='/etc/qos/iface_conf'
71IPADDRFILE="/etc/qos/ip_adresy"
722simandl 
7315simandl#default speeds and dividers
74DNONCZFSPD='64'
7525simandlDNONCONTRIBSPD='64'
7618simandlDAIRFREESPD='2048'
7715simandlDSSHDIV='2'
78DPINGDIV='2'
79DINTERACTDIV='2'
80DVOIPDIV='2'
81DWWWDIV='2'
82DXFERDIV='4'
83DDFLTDIV='8'
8413simandl 
852simandl### Configuration STOP
86 
87if [ ! -f $IFACECONFFILE ]
88then
89 echo "Interface configuration file doesn't exist - program terminated" 1>&2
90 exit 1
91fi
92 
934simandlIFACECONF=`grep -v '^[[:space:]]*#' $IFACECONFFILE`
94IFACECONF=`echo $IFACECONF | sed -e 's/[[:space:]]*}[[:space:]]*/}\\\n/g'`
95FACES=`echo -e $IFACECONF | sed -e 's/^[[:space:]]*interface[[:space:]]\+\([[:alnum:]]\+\).*/\1/;t;d'`
962simandl 
97echo "Applying CZF-QOS rules"
98 
99echo "-Set global variables"
100IPTABLES="`which iptables`"
101TC="`which tc`"
102IP="`which ip`"
103IPT_RESTORE="`which iptables-restore`"
104 
105STOCHASIS="sfq perturb 10"
106 
107QUANTUMOFFS="500"
108 
109#$IPT_RESTORE < /etc/network/iptables
110 
111echo "-Remove Qdisc root classes"
112for FACE in ${FACES} ; do
113 $TC qdisc del dev ${FACE} root &>/dev/null
11415simandl#echo $FACE
1152simandldone
116 
117## qoseni podle IP - priklad
118if [ -f $IPADDRFILE ]
119then
1204simandl NONCZF="`sed -e 's/^[[:space:]]*\([[:digit:].,/]\+\)[[:space:]].*NONCZF[[:space:]]*\+/\1/;t repl;d;: repl;y/,/ /' $IPADDRFILE`"
121 NONCZF="$NONCZF `sed -e 's/^.*[[:space:]]\+NONCZF[[:space:]]\+\([[:digit:].,/]\+\)[[:space:]]*/\1/;t repl;d;: repl;y/,/ /' $IPADDRFILE`"
12225simandl NONCONTRIB="`sed -e 's/^[[:space:]]*\([[:digit:].,/]\+\)[[:space:]].*NONCONTRIB[[:space:]]*\+/\1/;t repl;d;: repl;y/,/ /' $IPADDRFILE`"
123 NONCONTRIB="$NONCONTRIB `sed -e 's/^.*[[:space:]]\+NONCONTRIB[[:space:]]\+\([[:digit:].,/]\+\)[[:space:]]*/\1/;t repl;d;: repl;y/,/ /' $IPADDRFILE`"
1244simandl AIRFREE="`sed -e 's/^[[:space:]]*\([[:digit:].,/]\+\)[[:space:]].*AIRFREE[[:space:]]*\+/\1/;t repl;d;: repl;y/,/ /' $IPADDRFILE`"
125 AIRFREE="$AIRFREE `sed -e 's/^.*[[:space:]]\+AIRFREE[[:space:]]\+\([[:digit:].,/]\+\)[[:space:]]*/\1/;t repl;d;: repl;y/,/ /' $IPADDRFILE`"
1262simandlfi
127 
128set_qos_classes () {
129 echo "-Initializing QoS_base rules on interface $FACE (speed $SPEED)"
130 
131 $TC qdisc add dev ${FACE} root handle 1: htb default 300 r2q 2
132 $TC class add dev ${FACE} parent 1: classid 1:1 htb rate $((${SPEED}/2))kbit ceil ${SPEED}kbit burst 15k quantum ${QUANTUM}
13332simandl $TC class add dev ${FACE} parent 1:1 classid 1:5 htb rate 64kbit ceil $((${SPEED}/${SSHDIV}))kbit burst 5k prio 1 # SSH class
13438simandl $TC class add dev ${FACE} parent 1:1 classid 1:10 htb rate 192kbit ceil $((${SPEED}/${INTERACTDIV}))kbit burst 5k prio 1 # interactive class
13514simandl $TC class add dev ${FACE} parent 1:1 classid 1:20 htb rate 32kbit ceil $((${SPEED}/${PINGDIV}))kbit burst 5k prio 0
136 $TC class add dev ${FACE} parent 1:1 classid 1:30 htb rate 32kbit ceil 128kbit burst 5k prio 0 # routing class
13713simandl $TC class add dev ${FACE} parent 1:1 classid 1:40 htb rate 32kbit ceil $((${SPEED}/${XFERDIV}))kbit burst 5k prio 4 # email & data transfer class
13838simandl $TC class add dev ${FACE} parent 1:1 classid 1:50 htb rate 192kbit ceil $((${SPEED}/${VOIPDIV}))kbit burst 5k prio 0 # voip class
13913simandl $TC class add dev ${FACE} parent 1:1 classid 1:60 htb rate 32kbit ceil $((${SPEED}/${WWWDIV}))kbit burst 8k prio 3 # web & squid class
140 $TC class add dev ${FACE} parent 1:1 classid 1:300 htb rate 32kbit ceil $((${SPEED}/${DFLTDIV}))kbit burst 1k prio 5 # default trafic class
1412simandl $TC class add dev ${FACE} parent 1:1 classid 1:666 htb rate 32kbit ceil ${NONCZFSPD}kbit burst 1k prio 5 # unsupported trafic class
142 $TC class add dev ${FACE} parent 1:1 classid 1:667 htb rate 32kbit ceil ${AIRFREESPD}kbit burst 1k prio 4 # local wireless free band
14325simandl $TC class add dev ${FACE} parent 1:1 classid 1:668 htb rate 32kbit ceil ${NONCONTRIBSPD}kbit burst 1k prio 5 # non contributors trafic class
1444simandl# $TC class add dev ${FACE} parent 1:1 classid 1:999 htb rate 32kbit ceil $((${SPEED}/2))kbit burst 8k prio 4 # Inet traffic class
1452simandl 
146 $TC qdisc add dev ${FACE} parent 1:5 handle 5: $STOCHASIS # SSH sub-classes
147 $TC qdisc add dev ${FACE} parent 1:10 handle 10: $STOCHASIS # interactive sub-classes
148 $TC qdisc add dev ${FACE} parent 1:20 handle 20: $STOCHASIS # ping sub-classes
149 $TC qdisc add dev ${FACE} parent 1:30 handle 30: $STOCHASIS # routing sub-classes
15013simandl $TC qdisc add dev ${FACE} parent 1:40 handle 40: $STOCHASIS # email & data transfer sub-classes
151 $TC qdisc add dev ${FACE} parent 1:50 handle 50: $STOCHASIS # voip sub-classes
152 $TC qdisc add dev ${FACE} parent 1:60 handle 60: $STOCHASIS # web & squid sub-classes
1532simandl $TC qdisc add dev ${FACE} parent 1:300 handle 300: $STOCHASIS # default class
15425simandl $TC qdisc add dev ${FACE} parent 1:666 handle 666: $STOCHASIS # unsupported
155 $TC qdisc add dev ${FACE} parent 1:667 handle 667: $STOCHASIS # local wireless
156 $TC qdisc add dev ${FACE} parent 1:668 handle 668: $STOCHASIS # non contributor class
1574simandl# $TC qdisc add dev ${FACE} parent 1:999 handle 999: $STOCHASIS # Inet traffic
1582simandl 
159 
160 ## SSH class
161 # SSH
162 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 3 u32 match ip sport 22 0xffff match ip protocol 0x6 0xff flowid 1:5
163 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 3 u32 match ip dport 22 0xffff match ip protocol 0x6 0xff flowid 1:5
164 
165 ## Interactive class
16613simandl # NTP
167 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 123 0xffff match ip protocol 0x6 0xff flowid 1:10
168 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 123 0xffff match ip protocol 0x6 0xff flowid 1:10
169 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 123 0xffff match ip protocol 0x11 0xff flowid 1:10
170 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 123 0xffff match ip protocol 0x11 0xff flowid 1:10
1719simandl # DNS
1722simandl $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 53 0xffff match ip protocol 0x6 0xff flowid 1:10
173 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 53 0xffff match ip protocol 0x6 0xff flowid 1:10
174 # IRC
175 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 194 0xffff match ip protocol 0x6 0xff flowid 1:10
176 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 194 0xffff match ip protocol 0x6 0xff flowid 1:10
177 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 6667 0xffff match ip protocol 0x6 0xff flowid 1:10
178 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 6667 0xffff match ip protocol 0x6 0xff flowid 1:10
179 # LDAP, LDAPs
180 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 389 0xffff match ip protocol 0x6 0xff flowid 1:10
181 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 389 0xffff match ip protocol 0x6 0xff flowid 1:10
182 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 636 0xffff match ip protocol 0x6 0xff flowid 1:10
183 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 636 0xffff match ip protocol 0x6 0xff flowid 1:10
184 # GAMES
18538simandl # Sniper Elite
186 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 21540 0xffff match ip protocol 0x11 0xff flowid 1:10
187 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 21540 0xffff match ip protocol 0x11 0xff flowid 1:10
188 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 54468 0xffff match ip protocol 0x11 0xff flowid 1:10
189 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 54468 0xffff match ip protocol 0x11 0xff flowid 1:10
19023simandl # World Of Warcraft
19136simandl $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 8085 0xffff flowid 1:10
192 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 8085 0xffff flowid 1:10
193 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 3724 0xffff flowid 1:10
194 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 3724 0xffff flowid 1:10
19538simandl $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 6112 0xffff flowid 1:10
196 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 6112 0xffff flowid 1:10
19736simandl #6881..6999 is covered by (6880..6911 + 6912..6975 + 6976..7007)
19838simandl# $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 6880 0xffe0 flowid 1:10
199# $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 6880 0xffe0 flowid 1:10
20036simandl $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 6912 0xffc0 flowid 1:10
201 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 6912 0xffc0 flowid 1:10
202 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 6976 0xffe0 flowid 1:10
203 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 6976 0xffe0 flowid 1:10
20414simandl # vietcong
205 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 5425 0xffff match ip protocol 0x11 0xff flowid 1:10
206 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 5425 0xffff match ip protocol 0x11 0xff flowid 1:10
2077simandl # LINEAGE2
208 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 2106 0xffff match ip protocol 0x11 0xff flowid 1:10
209 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 2106 0xffff match ip protocol 0x11 0xff flowid 1:10
2102simandl # Half-life
211 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 27015 0xffff match ip protocol 0x11 0xff flowid 1:10
212 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 27015 0xffff match ip protocol 0x11 0xff flowid 1:10
213 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 27016 0xfffe match ip protocol 0x11 0xff flowid 1:10
214 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 27016 0xfffe match ip protocol 0x11 0xff flowid 1:10
2154simandl # UT2003, UT2004
2162simandl $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 7777 0xffff match ip protocol 0x11 0xff flowid 1:10
217 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 7777 0xffff match ip protocol 0x11 0xff flowid 1:10
218 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 7778 0xffff match ip protocol 0x11 0xff flowid 1:10
219 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 7778 0xffff match ip protocol 0x11 0xff flowid 1:10
2204simandl # BZFlag
221 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 5154 0xffff match ip protocol 0x11 0xff flowid 1:10
222 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 5154 0xffff match ip protocol 0x11 0xff flowid 1:10
2232simandl # JEDI KNIGHT
224 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 28060 0xfffe match ip protocol 0x11 0xff flowid 1:10
225 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 28060 0xfffe match ip protocol 0x11 0xff flowid 1:10
226 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 28062 0xffff match ip protocol 0x11 0xff flowid 1:10
227 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 28062 0xffff match ip protocol 0x11 0xff flowid 1:10
228 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 28070 0xfffe match ip protocol 0x11 0xff flowid 1:10
229 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 28070 0xfffe match ip protocol 0x11 0xff flowid 1:10
230 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 28072 0xfff8 match ip protocol 0x11 0xff flowid 1:10
231 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 28072 0xfff8 match ip protocol 0x11 0xff flowid 1:10
232 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 28080 0xfffe match ip protocol 0x11 0xff flowid 1:10
233 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 28080 0xfffe match ip protocol 0x11 0xff flowid 1:10
2345simandl # Dark Eden
235 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 9997 0xffff match ip protocol 0x11 0xff flowid 1:10
236 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 9997 0xffff match ip protocol 0x11 0xff flowid 1:10
237 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 9998 0xfffe match ip protocol 0x11 0xff flowid 1:10
238 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 9998 0xfffe match ip protocol 0x11 0xff flowid 1:10
239 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 9858 0xffff match ip protocol 0x11 0xff flowid 1:10
240 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 9858 0xffff match ip protocol 0x11 0xff flowid 1:10
241 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 9650 0xfffe match ip protocol 0x11 0xff flowid 1:10
242 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 9650 0xfffe match ip protocol 0x11 0xff flowid 1:10
243 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 4056 0xfffe match ip protocol 0x11 0xff flowid 1:10
244 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 4056 0xfffe match ip protocol 0x11 0xff flowid 1:10
24514simandl # Quake 3 arena
246 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 27960 0xfffe match ip protocol 0x11 0xff flowid 1:10
247 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 27960 0xfffe match ip protocol 0x11 0xff flowid 1:10
24819simandl # Counter-Strike Source
249 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 27000 0xfff8 match ip protocol 0x11 0xff flowid 1:10
250 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 27008 0xffc0 match ip protocol 0x11 0xff flowid 1:10
251 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 27072 0xfff0 match ip protocol 0x11 0xff flowid 1:10
252 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 27088 0xfff8 match ip protocol 0x11 0xff flowid 1:10
253 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 27096 0xfffc match ip protocol 0x11 0xff flowid 1:10
254 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 27000 0xfff8 match ip protocol 0x11 0xff flowid 1:10
255 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 27008 0xffc0 match ip protocol 0x11 0xff flowid 1:10
256 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 27072 0xfff0 match ip protocol 0x11 0xff flowid 1:10
257 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 27088 0xfff8 match ip protocol 0x11 0xff flowid 1:10
258 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 27096 0xfffc match ip protocol 0x11 0xff flowid 1:10
2595simandl # H323
2609simandl $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 389 0xffff match ip protocol 0x11 0xff flowid 1:10
261 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 389 0xffff match ip protocol 0x11 0xff flowid 1:10
262 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 522 0xffff match ip protocol 0x11 0xff flowid 1:10
263 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 522 0xffff match ip protocol 0x11 0xff flowid 1:10
264 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 1503 0xffff match ip protocol 0x11 0xff flowid 1:10
265 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 1503 0xffff match ip protocol 0x11 0xff flowid 1:10
266 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 1720 0xffff match ip protocol 0x11 0xff flowid 1:10
267 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 1720 0xffff match ip protocol 0x11 0xff flowid 1:10
268 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 1731 0xffff match ip protocol 0x11 0xff flowid 1:10
269 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 1731 0xffff match ip protocol 0x11 0xff flowid 1:10
27010simandl # Lineage2
271 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 7777 0xffff match ip protocol 0x6 0xff flowid 1:10
272 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 7777 0xffff match ip protocol 0x6 0xff flowid 1:10
273 # Teamspeak
274 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 8767 0xffff match ip protocol 0x11 0xff flowid 1:10
275 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 8767 0xffff match ip protocol 0x11 0xff flowid 1:10
27626simandl # L2TP
277 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 1701 0xffff match ip protocol 0x11 0xff flowid 1:10
278 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 1701 0xffff match ip protocol 0x11 0xff flowid 1:10
27927simandl # Americas Army
280 #UDP
281 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 1716 0xfffe match ip protocol 0x11 0xff flowid 1:10
282 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 1716 0xfffe match ip protocol 0x11 0xff flowid 1:10
283 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 1718 0xffff match ip protocol 0x11 0xff flowid 1:10
284 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 1718 0xffff match ip protocol 0x11 0xff flowid 1:10
285 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 8777 0xffff match ip protocol 0x11 0xff flowid 1:10
286 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 8777 0xffff match ip protocol 0x11 0xff flowid 1:10
287 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 27900 0xffff match ip protocol 0x11 0xff flowid 1:10
288 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 27900 0xffff match ip protocol 0x11 0xff flowid 1:10
289 #TCP
290 #14200
291 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 14200 0xffff match ip protocol 0x6 0xff flowid 1:10
292 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 14200 0xffff match ip protocol 0x6 0xff flowid 1:10
293 #20024 .. 20031
294 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 20024 0xfff8 match ip protocol 0x6 0xff flowid 1:10
295 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 20024 0xfff8 match ip protocol 0x6 0xff flowid 1:10
296 #20032 .. 20047
297 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 20032 0xfff0 match ip protocol 0x6 0xff flowid 1:10
298 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 20032 0xfff0 match ip protocol 0x6 0xff flowid 1:10
299 #20048
300 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 20048 0xffff match ip protocol 0x6 0xff flowid 1:10
301 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 20048 0xffff match ip protocol 0x6 0xff flowid 1:10
30229simandl # Warhammer Online
303 #TCP
304 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 1380 0xffff match ip protocol 0x6 0xff flowid 1:10
305 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 1380 0xffff match ip protocol 0x6 0xff flowid 1:10
306 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 10622 0xffff match ip protocol 0x6 0xff flowid 1:10
307 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 10622 0xffff match ip protocol 0x6 0xff flowid 1:10
308 #UDP 33100-33500 (32768-33791)
309 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 33100 0xfc00 match ip protocol 0x11 0xff flowid 1:10
310 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 33100 0xfc00 match ip protocol 0x11 0xff flowid 1:10
31130simandl #Battlefield 2
312 #TCP 16567, 16667
313 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 16567 0xfc00 match ip protocol 0x6 0xff flowid 1:10
314 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 16567 0xfc00 match ip protocol 0x6 0xff flowid 1:10
315 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 16667 0xfc00 match ip protocol 0x6 0xff flowid 1:10
316 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 16667 0xfc00 match ip protocol 0x6 0xff flowid 1:10
317 #Call of Duty 4
318 #port 28960 TCP a UDP
31941simandl $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 28960 0xffff flowid 1:10
320 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 28960 0xffff flowid 1:10
321 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 3074 0xfffe match ip protocol 0x11 0xff flowid 1:10
322 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 3074 0xfffe match ip protocol 0x11 0xff flowid 1:10
323 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 3080 0xffff match ip protocol 0x11 0xff flowid 1:10
324 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 3080 0xffff match ip protocol 0x11 0xff flowid 1:10
32530simandl 
3262simandl # TCP ACK packets smaller than 64 bytes
327 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 \
328 match ip protocol 6 0xff \
329 match u8 0x05 0x0f at 0 \
330 match u16 0x0000 0xffc0 at 2 \
331 match u8 0x10 0xff at 33 \
332 flowid 1:10
333 
334 ## Ping class
335 # ICMP
336 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip protocol 0x01 0xff flowid 1:20
337 
338 ## Routing class
339 # BGP
340 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 179 0xffff match ip protocol 0x6 0xff flowid 1:30
341 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 179 0xffff match ip protocol 0x6 0xff flowid 1:30
342 # OSPF
343 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip protocol 0x59 0xff flowid 1:30
344 
34513simandl ## Email & Data transfer class
3462simandl # FTP
347 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 20 0xfffe match ip protocol 0x6 0xff flowid 1:40
348 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 20 0xfffe match ip protocol 0x6 0xff flowid 1:40
349 # PPTP
350 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 1723 0xffff match ip protocol 0x6 0xff flowid 1:40
351 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 1723 0xffff match ip protocol 0x6 0xff flowid 1:40
352 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 1723 0xffff match ip protocol 0x11 0xff flowid 1:40
353 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 1723 0xffff match ip protocol 0x11 0xff flowid 1:40
3544simandl # OpenVPN
355 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 5000 0xffff match ip protocol 0x11 0xff flowid 1:40
356 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 5000 0xffff match ip protocol 0x11 0xff flowid 1:40
35738simandl $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 1194 0xffff match ip protocol 0x11 0xff flowid 1:40
358 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 1194 0xffff match ip protocol 0x11 0xff flowid 1:40
3592simandl # SCP
360 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 22 0xffff match ip protocol 0x6 0xff match ip tos 0x08 0xff flowid 1:40
361 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 22 0xffff match ip protocol 0x6 0xff match ip tos 0x08 0xff flowid 1:40
362 # POP3
36313simandl $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 110 0xffff match ip protocol 0x6 0xff flowid 1:40
364 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 110 0xffff match ip protocol 0x6 0xff flowid 1:40
3652simandl # IMAP
36613simandl $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 143 0xffff match ip protocol 0x6 0xff flowid 1:40
367 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 143 0xffff match ip protocol 0x6 0xff flowid 1:40
3682simandl # SMTP
36913simandl $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 25 0xffff match ip protocol 0x6 0xff flowid 1:40
370 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 25 0xffff match ip protocol 0x6 0xff flowid 1:40
3712simandl # POP3S
37213simandl $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 995 0xffff match ip protocol 0x6 0xff flowid 1:40
373 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 995 0xffff match ip protocol 0x6 0xff flowid 1:40
3742simandl # IMAPS
37513simandl $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 993 0xffff match ip protocol 0x6 0xff flowid 1:40
376 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 993 0xffff match ip protocol 0x6 0xff flowid 1:40
3772simandl # SSMTP
37813simandl $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 465 0xffff match ip protocol 0x6 0xff flowid 1:40
379 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 465 0xffff match ip protocol 0x6 0xff flowid 1:40
3802simandl # rsync
38113simandl $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 673 0xffff match ip protocol 0x6 0xff flowid 1:40
382 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 673 0xffff match ip protocol 0x6 0xff flowid 1:40
383 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 673 0xffff match ip protocol 0x11 0xff flowid 1:40
384 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 673 0xffff match ip protocol 0x11 0xff flowid 1:40
3852simandl # CVS
38613simandl $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 873 0xffff match ip protocol 0x6 0xff flowid 1:40
387 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 873 0xffff match ip protocol 0x6 0xff flowid 1:40
388 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 873 0xffff match ip protocol 0x11 0xff flowid 1:40
389 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 873 0xffff match ip protocol 0x11 0xff flowid 1:40
39039simandl # SVN
391 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 3690 0xffff flowid 1:40
392 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 3690 0xffff flowid 1:40
39340sinda # NNTP over SSL
394 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 563 0xffff flowid 1:40
395 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 563 0xffff flowid 1:40
396 # VNC
397 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 5900 0xffff flowid 1:40
398 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 5900 0xffff flowid 1:40
3992simandl 
40013simandl ## VOIP class
40133simandl # SIP
402 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 5060 0xfffe match ip protocol 0x11 0xff flowid 1:50
403 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 5060 0xfffe match ip protocol 0x11 0xff flowid 1:50
404 # RTP
405 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 8000 0xffff match ip protocol 0x11 0xff flowid 1:50
406 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 8000 0xffff match ip protocol 0x11 0xff flowid 1:50
40738simandl # Skype typeofservice mark
408 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip tos 0x20 0xff flowid 1:50 #Skype?
40913simandl # VoIP typeofservice mark
410 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip tos 0x68 0xff flowid 1:50 #SIP
411 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip tos 0xb8 0xff flowid 1:50 #RTP
412 # VoIP typeofservice mark for RTP ha-vel.cz
41338simandl $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip tos 0x16 0xff flowid 1:50 #RTP
41413simandl # TOS mimimize delay - VoIP typeofservice mark for RTP vox.802.cz
41538simandl $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip tos 0x10 0xff flowid 1:50
41618simandl # VoIP IP addr for RTP ha-vel.cz
417 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip src 217.66.161.0/28 flowid 1:50 #RTP
418 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dst 217.66.161.0/28 flowid 1:50 #RTP
419 # VoIP IP addr for RTP 802.cz
42044simandl $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip src 212.71.146.128/26 flowid 1:50 #RTP rtp.802.cz
421 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dst 212.71.146.128/26 flowid 1:50 #RTP rtp.802.cz
42231simandl # VoIP IP addr for others RTP
423 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip src 62.168.42.145 flowid 1:50 #sip2.fayn.cz
424 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dst 62.168.42.145 flowid 1:50 #sip2.fayn.cz
425 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip src 82.208.46.240 flowid 1:50 #sip.mujtelefon.cz
426 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dst 82.208.46.240 flowid 1:50 #sip.mujtelefon.cz
42733simandl $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip src 212.20.119.40/29 flowid 1:50 #sip1.netphone.cz
428 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dst 212.20.119.40/29 flowid 1:50 #sip1.netphone.cz
42931simandl $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip src 81.91.216.18 flowid 1:50 #aps.sbohempevnalinko.cz
430 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dst 81.91.216.18 flowid 1:50 #aps.sbohempevnalinko.cz
431 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip src 81.91.216.11 flowid 1:50 #fax.sipcz.net
432 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dst 81.91.216.11 flowid 1:50 #fax.sipcz.net
43338simandl $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip src 193.86.76.226 match ip protocol 0x11 0xff flowid 1:50 #ustredna.systinet.com
434 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dst 193.86.76.226 match ip protocol 0x11 0xff flowid 1:50 #ustredna.systinet.com
43533simandl # gnomemeeting
436 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 30000 0xfff8 match ip protocol 0x11 0xff flowid 1:50
437 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 30000 0xfff8 match ip protocol 0x11 0xff flowid 1:50
438 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 30008 0xfffe match ip protocol 0x11 0xff flowid 1:50
439 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 30008 0xfffe match ip protocol 0x11 0xff flowid 1:50
440 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 30010 0xffff match ip protocol 0x11 0xff flowid 1:50
441 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 30010 0xffff match ip protocol 0x11 0xff flowid 1:50
442 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 5000 0xfff8 match ip protocol 0x11 0xff flowid 1:50
443 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 5000 0xfff8 match ip protocol 0x11 0xff flowid 1:50
444 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 5010 0xfffe match ip protocol 0x11 0xff flowid 1:50
445 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 5010 0xfffe match ip protocol 0x11 0xff flowid 1:50
446 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 5012 0xfffe match ip protocol 0x11 0xff flowid 1:50
447 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 5012 0xfffe match ip protocol 0x11 0xff flowid 1:50
44834simandl #ventrilo 3784 .. 3791
449 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 3784 0xfff8 match ip protocol 0x6 0xff flowid 1:10
450 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 3784 0xfff8 match ip protocol 0x6 0xff flowid 1:10
45113simandl 
452 ## Web & Squid class
453 # HTTP
454 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 80 0xffff match ip protocol 0x6 0xff flowid 1:60
455 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 80 0xffff match ip protocol 0x6 0xff flowid 1:60
456 # HTTPS
457 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 443 0xffff match ip protocol 0x6 0xff flowid 1:60
458 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 443 0xffff match ip protocol 0x6 0xff flowid 1:60
459 # WebCache
460 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 8080 0xffff match ip protocol 0x6 0xff flowid 1:60
461 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 8080 0xffff match ip protocol 0x6 0xff flowid 1:60
4622simandl # HTTP port
463 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 3128 0xffff match ip protocol 0x6 0xff flowid 1:60
464 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 3128 0xffff match ip protocol 0x6 0xff flowid 1:60
465 # ICP port
466 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 3130 0xffff match ip protocol 0x6 0xff flowid 1:60
467 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 3130 0xffff match ip protocol 0x6 0xff flowid 1:60
46833simandl # VPN KB.CZ
469 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip src 194.228.113.135 match ip sport 4500 0xffff match ip protocol 0x11 0xff flowid 1:60
470 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dst 194.228.113.135 match ip dport 4500 0xffff match ip protocol 0x11 0xff flowid 1:60
47142simandl # Cisco VPN
47243simandl $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 500 0xffff flowid 1:60
473 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 500 0xffff flowid 1:60
474 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 4500 0xffff flowid 1:60
475 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 4500 0xffff flowid 1:60
476 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 10000 0xffff flowid 1:60
477 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 10000 0xffff flowid 1:60
4782simandl 
47933simandl 
4802simandl ## Unsupported class
48133simandl # Kazaa
482 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 1214 0xffff match ip protocol 0x6 0xff flowid 1:666
483 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 1214 0xffff match ip protocol 0x6 0xff flowid 1:666
484 
485 ## Airfree class
48631simandl # File download over http
48732simandl $TC filter add dev ${FACE} parent 1:0 protocol ip prio 1 u32 match ip src 62.67.46.0/24 flowid 1:667 # TERASPACE-GMBH
488 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 1 u32 match ip src 62.67.50.0/24 flowid 1:667 # TERASPACE-GMBH
489 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 1 u32 match ip src 62.140.31.0/24 flowid 1:667 # TERASPACE-GMBH
490 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 1 u32 match ip src 64.211.146.0/24 flowid 1:667 # TERASPACE-GMBH
491 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 1 u32 match ip src 80.152.62.0/24 flowid 1:667 # TERASPACE-GMBH
492 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 1 u32 match ip src 80.231.24.0/24 flowid 1:667 # TERASPACE-GMBH
493 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 1 u32 match ip src 80.231.41.0/24 flowid 1:667 # TERASPACE-GMBH
494 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 1 u32 match ip src 80.239.137.0/24 flowid 1:667 # TERASPACE-GMBH
495 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 1 u32 match ip src 80.239.236.0/24 flowid 1:667 # TERASPACE-GMBH
496 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 1 u32 match ip src 82.129.39.0/24 flowid 1:667 # PA-TERASPACE-COGENT-1
497 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 1 u32 match ip src 195.122.131.0/24 flowid 1:667 # TERASPACE-GMBH
498 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 1 u32 match ip src 195.122.151.0/24 flowid 1:667 # TERASPACE-GMBH
499 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 1 u32 match ip src 195.122.152.0/23 flowid 1:667 # TERASPACE-GMBH
500 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 1 u32 match ip src 195.219.1.0/24 flowid 1:667 # TERASPACE-GB
501 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 1 u32 match ip src 206.57.14.0/24 flowid 1:667 # TERAS
50235simandl $TC filter add dev ${FACE} parent 1:0 protocol ip prio 1 u32 match ip src 212.162.2.0/24 flowid 1:667 # TERASPACE-GMBH
50333simandl $TC filter add dev ${FACE} parent 1:0 protocol ip prio 1 u32 match ip src 212.162.63.0/24 flowid 1:667 # TERASPACE-GMBH
50432simandl $TC filter add dev ${FACE} parent 1:0 protocol ip prio 1 u32 match ip src 77.88.62.0/24 flowid 1:667 # yandex.ru
505 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 1 u32 match ip src 83.229.252.0/23 flowid 1:667 # MCHOST-SYN-NET
506 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 1 u32 match ip src 85.17.172.0/24 flowid 1:667 # LEASEWEB (filefactory.com)
507 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 1 u32 match ip src 94.75.218.0/24 flowid 1:667 # LEASEWEB
508 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 1 u32 match ip src 78.140.128.0/18 flowid 1:667 # NL-WEBAZILLA
509 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 1 u32 match ip src 88.86.100.160/27 flowid 1:667 # uloz.to
510 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 1 u32 match ip src 88.208.16.0/20 flowid 1:667 # HALDEX-NET (letitbit.net)
51131simandl 
5122simandl # IP range of DHCP for airfree AP on this router
513 for ipaddr in $AIRFREE
514 do
515 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 1 u32 match ip src $ipaddr flowid 1:667
516 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 1 u32 match ip dst $ipaddr flowid 1:667
517 done
518 # non-CZF-RFC - violators of RFCs
519 for ipaddr in $NONCZF
520 do
521 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 1 u32 match ip src $ipaddr flowid 1:666
522 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 1 u32 match ip dst $ipaddr flowid 1:666
523 done
52425simandl # non-contributors
525 for ipaddr in $NONCONTRIB
526 do
527 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 1 u32 match ip src $ipaddr flowid 1:668
528 $TC filter add dev ${FACE} parent 1:0 protocol ip prio 1 u32 match ip dst $ipaddr flowid 1:668
529 done
5302simandl 
5314simandl ## Internet class
5322simandl # IPtables rule
533# $IPTABLES -t mangle -A FORWARD -s ! 10.0.0.0/8 -o ${FACE} -j MARK --set-mark 999
534# $IPTABLES -t mangle -A FORWARD -d ! 10.0.0.0/8 -o ${FACE} -j MARK --set-mark 999
535 # IPtables mark filter
536# $TC filter add dev ${FACE} parent 1:0 protocol ip prio 1 handle 999 fw flowid 1:999
537}
538 
539for FACE in $FACES
540do
5414simandl if [ -z "`$IP l | grep $FACE[:@]`" ]
542 then
543 echo "Interface $FACE doesn't exist"
544 continue
545 fi
5462simandl TYPE=`echo -e $IFACECONF | grep $FACE | sed -e "s/^.*{.*type[[:space:]]\+\([[:alpha:]]\+\).*}.*/\1/"`
547 if [ "$TYPE" != 'transit' ]
548 then
549 continue
550 fi
551 SPEED=`echo -e $IFACECONF | grep $FACE | sed -e "s/^.*{.*speed[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"`
552 QUANTUM=`echo -e $IFACECONF | grep $FACE | sed -e "s/^.*{.*quantum[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"`
553 
554 if [ -z "$QUANTUM" ]
555 then
5564simandl MTU=`$IP l | grep $FACE[:@] | sed -e "s/^.*mtu[[:space:]]\+\([[:digit:]]\+\).*/\1/"`
5572simandl QUANTUM=$(($QUANTUMOFFS+$MTU))
558 fi
55915simandl 
560 NONCZFSPD=`echo -e $IFACECONF | grep $FACE | sed -e "s/^.*{.*NONCZFSPD[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"`
561 if [ -z $NONCZFSPD ] ; then NONCZFSPD=$DNONCZFSPD ; fi
562 
563 AIRFREESPD=`echo -e $IFACECONF | grep $FACE | sed -e "s/^.*{.*AIRFREESPD[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"`
564 if [ -z $AIRFREESPD ] ; then AIRFREESPD=$DAIRFREESPD ; fi
565 
56625simandl NONCONTRIBSPD=`echo -e $IFACECONF | grep $FACE | sed -e "s/^.*{.*NONCONTRIBSPD[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"`
567 if [ -z $NONCONTRIBSPD ] ; then NONCONTRIBSPD=$DNONCONTRIBSPD ; fi
568 
56915simandl SSHDIV=`echo -e $IFACECONF | grep $FACE | sed -e "s/^.*{.*SSHDIV[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"`
570 if [ -z $SSHDIV ] ; then SSHDIV=$DSSHDIV ; fi
571 
572 PINGDIV=`echo -e $IFACECONF | grep $FACE | sed -e "s/^.*{.*PINGDIV[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"`
573 if [ -z $PINGDIV ] ; then PINGDIV=$DPINGDIV ; fi
574 
575 INTERACTDIV=`echo -e $IFACECONF | grep $FACE | sed -e "s/^.*{.*INTERACTDIV[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"`
576 if [ -z $INTERACTDIV ] ; then INTERACTDIV=$DINTERACTDIV ; fi
577 
578 VOIPDIV=`echo -e $IFACECONF | grep $FACE | sed -e "s/^.*{.*VOIPDIV[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"`
579 if [ -z $VOIPDIV ] ; then VOIPDIV=$DVOIPDIV ; fi
580 
581 WWWDIV=`echo -e $IFACECONF | grep $FACE | sed -e "s/^.*{.*WWWDIV[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"`
582 if [ -z $WWWDIV ] ; then WWWDIV=$DWWWDIV ; fi
583 
584 XFERDIV=`echo -e $IFACECONF | grep $FACE | sed -e "s/^.*{.*XFERDIV[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"`
585 if [ -z $XFERDIV ] ; then XFERDIV=$DXFERDIV ; fi
586 
587 DFLTDIV=`echo -e $IFACECONF | grep $FACE | sed -e "s/^.*{.*DFLTDIV[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"`
588 if [ -z $DFLTDIV ] ; then DFLTDIV=$DDFLTDIV ; fi
589 
590#echo $SPEED $NONCZFSPD $AIRFREESPD $SSHDIV $PINGDIV $INTERACTDIV $VOIPDIV $WWWDIV $XFERDIV $DFLTDIV
5912simandl set_qos_classes
592done
593 
594exit 0

Powered by WebSVN 2.2.1