1 | 2 | simandl | #!/bin/sh |
2 | | | # |
3 | | | # CZFree.Net RFC-QoS script |
4 | | | # |
5 | 26 | simandl | # date: 30/06/2008 |
6 | 28 | simandl | # authors: Rakerihoo, Fyzik, Libor, Dzus, Bonez, Simandl, Danny, Sinda |
7 | 2 | simandl | # references: http://www.lartc.org/ |
8 | | | # http://luxik.cdi.cz/~devik/qos/htb/ |
9 | 28 | simandl | # http://connected.prosek.czf/forum/showthread.php?s=&threadid=9 |
10 | 13 | simandl | # http://www.simandl.cz/stranky/linux/qos/soubory/qos_base |
11 | 4 | simandl | # version: 2.1.6 |
12 | 29 | simandl | # ps ver : 0.1.9 |
13 | 2 | simandl | # |
14 | | | # Changelog |
15 | | | # |
16 | 59 | simandl | # 02/09/10 [simandl] pridan port 9987 pro ts3 a 3784 pro ventrilo |
17 | 58 | simandl | # 12/08/10 [simandl] pridana ip 213.168.165.12 sip.fayn.cz |
18 | 56 | simandl | # 03/08/10 [simandl] StarCraft II port 1119 |
19 | 57 | simandl | # 28/05/10 [sinda] podpora pro VoIP ipex.cz (voip.pe3ny.net) |
20 | 54 | sinda | # 28/04/09 [sinda] podpora pro hru rFactor (TCP 34447, UDP 34397) |
21 | 53 | sinda | # 14/04/09 [sinda] rtp ha-vel oprava prefixu 28 -> 24 |
22 | 52 | sinda | # 05/04/09 [sinda] VATSIM Microsoft Flight simulator FS2004 (TCP/UDP 6809, 6073, 3782 a 3290) |
23 | 51 | sinda | # 25/03/09 [sinda] VoIP IP addr for sip.volny.cz (rtp servery) |
24 | 50 | simandl | # 20/03/09 [simandl] VoIP IP addr for sip.volny.cz |
25 | 49 | sinda | # 18/03/09 [sinda] podpora ip RTP pro VoIP od t-com.sk (195.146.137.186/31 TCP/UDP) |
26 | 48 | simandl | # 13/03/09 [simandl] OpenVPN presunuto do web tridy |
27 | 47 | sinda | # 03/03/09 [sinda] podpora obecne pro PS3 (TCP: 5223, 10070-10080, UDP: 3478-3479, 3658, 3678, 10070-10080) |
28 | 46 | sinda | # 03/03/09 [sinda] uprava ceil trid, snaha o rozliseni preferenci |
29 | | | # 03/03/09 [sinda] oprava podpory pro Battlefield 2 (TCP 16567, 16667) |
30 | 45 | sinda | # 26/02/09 [sinda] podpora pro Vonage voip, UDP vse z 69.59.241/24 |
31 | 44 | simandl | # 11/02/09 [simandl] za provoz na 802.cz povazovano vse v subnetu 212.71.146.128/26 |
32 | | | # 10/02/09 [simandl] doplnena podpora pro Cisco VPN |
33 | 41 | simandl | # 09/02/09 [sinda] doplnena podpora pro Call of Duty 4 (na PS3) - UDP: 3074, 3075, 3080 |
34 | 40 | sinda | # 02/02/09 [sinda] doplnena podpora pro nntps a vnc do tridy 40 (data transfer) |
35 | 39 | simandl | # 25/01/09 [simandl] doplnena podpora pro svn port 3690 |
36 | 38 | simandl | # 14/01/09 [sinda] doplnena podpora pro hru "Sniper Elite" porty UDP 21540 a 54468 |
37 | | | # 13/01/09 [sinda] doplnena podpora pro RTP dle ip operatora systinet.com a rozsireni portu OpenVPN o 1194/UDP |
38 | 37 | simandl | # 07/01/09 [simandl] doplnena podpora pro hru "World Of Warcraft" porty 6112 a 6881-6999 |
39 | 34 | simandl | # 23/12/08 [simandl] podpora pro ventrilo |
40 | 31 | simandl | # 04/12/08 [sinda] doplnena podpora pro RTP dle ip operatoru fayn.cz, mujtelefon.cz, netphone.cz, aps.sbohempevnalinko.cz, fax.sipcz.net |
41 | 32 | simandl | # 01/12/08 [sinda] File download over http do class airfree (TERASPACE-GMBH, yandex.ru, ...) |
42 | 30 | simandl | # 04/11/08 [simandl] podpora pro hry "Battlefield" a "Call of Duty" |
43 | 29 | simandl | # 13/10/08 [simandl] podpora pro hru "Warhammer Online" |
44 | 28 | simandl | # 28/09/08 [simandl] doplneni chybejicich autoru a zmena v references 10.24.1.2 na connected.prosek.czf |
45 | 27 | simandl | # 05/08/08 [simandl] podpora pro Americas Army |
46 | 26 | simandl | # 30/06/08 [simandl] podpora pro L2TP port 1701 UDP |
47 | 25 | simandl | # 09/03/08 [simandl] podpora pro noncontrib |
48 | 23 | simandl | # 01/12/07 [simandl] doplnena podpora pro hru "World Of Warcraft" 8085 3724 |
49 | 19 | simandl | # 09/08/07 [sinda] doplnena podpora pro hru "Counter-Strike Source" UDP 270xx |
50 | 18 | simandl | # 26/07/07 [sinda] doplnena podpora pro RTP ha-vel.cz a 802.cz dle ip adresy rtp serveru operatora |
51 | 15 | simandl | # 31/08/06 [simandl] doplnena podpora pro definici rychlosti a delitelu pro kazdy iface zvlast v souboru iface_conf |
52 | 14 | simandl | # 14/07/06 [sinda] doplneny porty pro hru Quake 3 arena |
53 | 13 | simandl | # 17/01/06 [simandl] doplneny TOSy pro ha-vel a hlas.802.cz do VoIP tridy 50 |
54 | | | # 12/12/05 [simandl] preskupeny protokoly trid - 40 mail&data 50 voip 60 web&squid - tak aby byly rovnomerne vyuzite |
55 | 10 | simandl | # 23/11/05 [simandl] doplneny porty pro Lineage2 a Teamspeak |
56 | 9 | simandl | # 22/11/05 [danny] DSCP/ToS filtry pro SIP/RTP (VoIP), maximum reliability [DEV] |
57 | 8 | simandl | # 20/11/05 [simandl] doplnen port pro RTP |
58 | 6 | simandl | # 14/11/05 [simandl] doplneny porty pro SIP a gnomemeeting |
59 | 5 | simandl | # 08/11/05 [simandl] doplneny porty pro H.323 |
60 | | | # 19/08/05 [simandl] doplneny porty pro hru DarkEden |
61 | 4 | simandl | # 30/10/04 [dzus] oprava parseru MTU, vylepseni kontroly konfig. souboru |
62 | | | # 27/10/04 [bonez] OpenVPN pridano do data transfer class |
63 | | | # 05/06/04 [dzus] do interactive class pridan BZFlag, uprava parseru konfig souboru |
64 | 2 | simandl | # 18/02/04 [dzus] SCP zarazeno do download class (rozliseno podle TOS maximize throughput) |
65 | | | # 04/01/04 [dzus] podpora pro Jedi Knight, oprava prio u filtru, oprava filtru na FTP, zruseni PPTP class |
66 | | | # 20/11/03 [dzus] zrusena H323 class, pridan filtr na TCP ACK, nastaveni quantum podle MTU |
67 | | | # 28/09/03 [dzus] oprava bugu ve filtrech (bez prio to nechodi dobre) |
68 | | | # 27/09/03 [dzus] konfigurace interfacu se nacita z ext souboru, pridan TOS minimize delay filtr |
69 | | | # 20/09/03 [dzus] vyhazeni marku z IPtables, nyni pouze filtry v tc |
70 | | | # 01/09/03 [dzus] vynechani internetoveho rozhrani z konfigurace |
71 | | | # 07/08/03 [fyzik] preference Inetoveho traffiku |
72 | | | # 31/07/03 [fyzik] podpora pro HL@tchor, airfree, fixes |
73 | | | # 05/05/03 [fyzik] podpora pro IRC, PPTP, H323, LDAP, DC, NTP |
74 | | | # 04/05/03 [fyzik] napsal uvod |
75 | | | # 01/05/03 [fyzik] non-CZF-RFC, inspirovan Liborovym Heaven QoS |
76 | | | # 00/03/03 [Rakerihoo] napsal RFC-QoS :) |
77 | | | # |
78 | | | # ToDo |
79 | | | # * zkusit a otestovat podtridy CZF-transfer, CZF-klient, CZF-shared a markovanat podle MAC |
80 | | | # * pridat podporu ostatnich interaktivnich games |
81 | | | |
82 | | | |
83 | | | ### Configuration START |
84 | | | |
85 | 21 | simandl | IFACECONFFILE='/etc/qos/iface_conf' |
86 | | | IPADDRFILE="/etc/qos/ip_adresy" |
87 | 2 | simandl | |
88 | 15 | simandl | #default speeds and dividers |
89 | | | DNONCZFSPD='64' |
90 | 25 | simandl | DNONCONTRIBSPD='64' |
91 | 18 | simandl | DAIRFREESPD='2048' |
92 | 15 | simandl | DSSHDIV='2' |
93 | | | DPINGDIV='2' |
94 | | | DINTERACTDIV='2' |
95 | | | DVOIPDIV='2' |
96 | | | DWWWDIV='2' |
97 | | | DXFERDIV='4' |
98 | | | DDFLTDIV='8' |
99 | 13 | simandl | |
100 | 2 | simandl | ### Configuration STOP |
101 | | | |
102 | | | if [ ! -f $IFACECONFFILE ] |
103 | | | then |
104 | | | echo "Interface configuration file doesn't exist - program terminated" 1>&2 |
105 | | | exit 1 |
106 | | | fi |
107 | | | |
108 | 4 | simandl | IFACECONF=`grep -v '^[[:space:]]*#' $IFACECONFFILE` |
109 | | | IFACECONF=`echo $IFACECONF | sed -e 's/[[:space:]]*}[[:space:]]*/}\\\n/g'` |
110 | | | FACES=`echo -e $IFACECONF | sed -e 's/^[[:space:]]*interface[[:space:]]\+\([[:alnum:]]\+\).*/\1/;t;d'` |
111 | 2 | simandl | |
112 | | | echo "Applying CZF-QOS rules" |
113 | | | |
114 | | | echo "-Set global variables" |
115 | | | IPTABLES="`which iptables`" |
116 | | | TC="`which tc`" |
117 | | | IP="`which ip`" |
118 | | | IPT_RESTORE="`which iptables-restore`" |
119 | | | |
120 | | | STOCHASIS="sfq perturb 10" |
121 | | | |
122 | | | QUANTUMOFFS="500" |
123 | | | |
124 | | | #$IPT_RESTORE < /etc/network/iptables |
125 | | | |
126 | | | echo "-Remove Qdisc root classes" |
127 | | | for FACE in ${FACES} ; do |
128 | | | $TC qdisc del dev ${FACE} root &>/dev/null |
129 | 15 | simandl | #echo $FACE |
130 | 2 | simandl | done |
131 | | | |
132 | | | ## qoseni podle IP - priklad |
133 | | | if [ -f $IPADDRFILE ] |
134 | | | then |
135 | 4 | simandl | NONCZF="`sed -e 's/^[[:space:]]*\([[:digit:].,/]\+\)[[:space:]].*NONCZF[[:space:]]*\+/\1/;t repl;d;: repl;y/,/ /' $IPADDRFILE`" |
136 | | | NONCZF="$NONCZF `sed -e 's/^.*[[:space:]]\+NONCZF[[:space:]]\+\([[:digit:].,/]\+\)[[:space:]]*/\1/;t repl;d;: repl;y/,/ /' $IPADDRFILE`" |
137 | 25 | simandl | NONCONTRIB="`sed -e 's/^[[:space:]]*\([[:digit:].,/]\+\)[[:space:]].*NONCONTRIB[[:space:]]*\+/\1/;t repl;d;: repl;y/,/ /' $IPADDRFILE`" |
138 | | | NONCONTRIB="$NONCONTRIB `sed -e 's/^.*[[:space:]]\+NONCONTRIB[[:space:]]\+\([[:digit:].,/]\+\)[[:space:]]*/\1/;t repl;d;: repl;y/,/ /' $IPADDRFILE`" |
139 | 4 | simandl | AIRFREE="`sed -e 's/^[[:space:]]*\([[:digit:].,/]\+\)[[:space:]].*AIRFREE[[:space:]]*\+/\1/;t repl;d;: repl;y/,/ /' $IPADDRFILE`" |
140 | | | AIRFREE="$AIRFREE `sed -e 's/^.*[[:space:]]\+AIRFREE[[:space:]]\+\([[:digit:].,/]\+\)[[:space:]]*/\1/;t repl;d;: repl;y/,/ /' $IPADDRFILE`" |
141 | 2 | simandl | fi |
142 | | | |
143 | | | set_qos_classes () { |
144 | | | echo "-Initializing QoS_base rules on interface $FACE (speed $SPEED)" |
145 | | | |
146 | | | $TC qdisc add dev ${FACE} root handle 1: htb default 300 r2q 2 |
147 | | | $TC class add dev ${FACE} parent 1: classid 1:1 htb rate $((${SPEED}/2))kbit ceil ${SPEED}kbit burst 15k quantum ${QUANTUM} |
148 | 32 | simandl | $TC class add dev ${FACE} parent 1:1 classid 1:5 htb rate 64kbit ceil $((${SPEED}/${SSHDIV}))kbit burst 5k prio 1 # SSH class |
149 | 38 | simandl | $TC class add dev ${FACE} parent 1:1 classid 1:10 htb rate 192kbit ceil $((${SPEED}/${INTERACTDIV}))kbit burst 5k prio 1 # interactive class |
150 | 46 | sinda | $TC class add dev ${FACE} parent 1:1 classid 1:20 htb rate 64kbit ceil $((${SPEED}/${PINGDIV}))kbit burst 5k prio 0 |
151 | | | $TC class add dev ${FACE} parent 1:1 classid 1:30 htb rate 64kbit ceil 128kbit burst 5k prio 0 # routing class |
152 | | | $TC class add dev ${FACE} parent 1:1 classid 1:40 htb rate 48kbit ceil $((${SPEED}/${XFERDIV}))kbit burst 5k prio 4 # email & data transfer class |
153 | 38 | simandl | $TC class add dev ${FACE} parent 1:1 classid 1:50 htb rate 192kbit ceil $((${SPEED}/${VOIPDIV}))kbit burst 5k prio 0 # voip class |
154 | 46 | sinda | $TC class add dev ${FACE} parent 1:1 classid 1:60 htb rate 48kbit ceil $((${SPEED}/${WWWDIV}))kbit burst 8k prio 3 # web & squid class |
155 | 13 | simandl | $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 |
156 | 2 | simandl | $TC class add dev ${FACE} parent 1:1 classid 1:666 htb rate 32kbit ceil ${NONCZFSPD}kbit burst 1k prio 5 # unsupported trafic class |
157 | | | $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 |
158 | 25 | simandl | $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 |
159 | 4 | simandl | # $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 |
160 | 2 | simandl | |
161 | | | $TC qdisc add dev ${FACE} parent 1:5 handle 5: $STOCHASIS # SSH sub-classes |
162 | | | $TC qdisc add dev ${FACE} parent 1:10 handle 10: $STOCHASIS # interactive sub-classes |
163 | | | $TC qdisc add dev ${FACE} parent 1:20 handle 20: $STOCHASIS # ping sub-classes |
164 | | | $TC qdisc add dev ${FACE} parent 1:30 handle 30: $STOCHASIS # routing sub-classes |
165 | 13 | simandl | $TC qdisc add dev ${FACE} parent 1:40 handle 40: $STOCHASIS # email & data transfer sub-classes |
166 | | | $TC qdisc add dev ${FACE} parent 1:50 handle 50: $STOCHASIS # voip sub-classes |
167 | | | $TC qdisc add dev ${FACE} parent 1:60 handle 60: $STOCHASIS # web & squid sub-classes |
168 | 2 | simandl | $TC qdisc add dev ${FACE} parent 1:300 handle 300: $STOCHASIS # default class |
169 | 25 | simandl | $TC qdisc add dev ${FACE} parent 1:666 handle 666: $STOCHASIS # unsupported |
170 | | | $TC qdisc add dev ${FACE} parent 1:667 handle 667: $STOCHASIS # local wireless |
171 | | | $TC qdisc add dev ${FACE} parent 1:668 handle 668: $STOCHASIS # non contributor class |
172 | 4 | simandl | # $TC qdisc add dev ${FACE} parent 1:999 handle 999: $STOCHASIS # Inet traffic |
173 | 2 | simandl | |
174 | | | |
175 | | | ## SSH class |
176 | | | # SSH |
177 | | | $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 |
178 | | | $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 |
179 | | | |
180 | | | ## Interactive class |
181 | 13 | simandl | # NTP |
182 | | | $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 |
183 | | | $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 |
184 | | | $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 |
185 | | | $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 |
186 | 9 | simandl | # DNS |
187 | 2 | simandl | $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 |
188 | | | $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 |
189 | | | # IRC |
190 | | | $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 |
191 | | | $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 |
192 | | | $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 |
193 | | | $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 |
194 | | | # LDAP, LDAPs |
195 | | | $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 |
196 | | | $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 |
197 | | | $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 |
198 | | | $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 |
199 | | | # GAMES |
200 | 38 | simandl | # Sniper Elite |
201 | | | $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 |
202 | | | $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 |
203 | | | $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 |
204 | | | $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 |
205 | 23 | simandl | # World Of Warcraft |
206 | 36 | simandl | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 8085 0xffff flowid 1:10 |
207 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 8085 0xffff flowid 1:10 |
208 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 3724 0xffff flowid 1:10 |
209 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 3724 0xffff flowid 1:10 |
210 | 38 | simandl | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 6112 0xffff flowid 1:10 |
211 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 6112 0xffff flowid 1:10 |
212 | 36 | simandl | #6881..6999 is covered by (6880..6911 + 6912..6975 + 6976..7007) |
213 | 38 | simandl | # $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 6880 0xffe0 flowid 1:10 |
214 | | | # $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 6880 0xffe0 flowid 1:10 |
215 | 36 | simandl | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 6912 0xffc0 flowid 1:10 |
216 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 6912 0xffc0 flowid 1:10 |
217 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 6976 0xffe0 flowid 1:10 |
218 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 6976 0xffe0 flowid 1:10 |
219 | 14 | simandl | # vietcong |
220 | | | $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 |
221 | | | $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 |
222 | 7 | simandl | # LINEAGE2 |
223 | | | $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 |
224 | | | $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 |
225 | 2 | simandl | # Half-life |
226 | | | $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 |
227 | | | $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 |
228 | | | $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 |
229 | | | $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 |
230 | 4 | simandl | # UT2003, UT2004 |
231 | 2 | simandl | $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 |
232 | | | $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 |
233 | | | $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 |
234 | | | $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 |
235 | 4 | simandl | # BZFlag |
236 | | | $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 |
237 | | | $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 |
238 | 2 | simandl | # JEDI KNIGHT |
239 | | | $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 |
240 | | | $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 |
241 | | | $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 |
242 | | | $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 |
243 | | | $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 |
244 | | | $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 |
245 | | | $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 |
246 | | | $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 |
247 | | | $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 |
248 | | | $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 |
249 | 5 | simandl | # Dark Eden |
250 | | | $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 |
251 | | | $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 |
252 | | | $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 |
253 | | | $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 |
254 | | | $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 |
255 | | | $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 |
256 | | | $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 |
257 | | | $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 |
258 | | | $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 |
259 | | | $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 |
260 | 14 | simandl | # Quake 3 arena |
261 | | | $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 |
262 | | | $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 |
263 | 19 | simandl | # Counter-Strike Source |
264 | | | $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 |
265 | | | $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 |
266 | | | $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 |
267 | | | $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 |
268 | | | $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 |
269 | | | $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 |
270 | | | $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 |
271 | | | $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 |
272 | | | $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 |
273 | | | $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 |
274 | 5 | simandl | # H323 |
275 | 9 | simandl | $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 |
276 | | | $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 |
277 | | | $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 |
278 | | | $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 |
279 | | | $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 |
280 | | | $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 |
281 | | | $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 |
282 | | | $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 |
283 | | | $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 |
284 | | | $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 |
285 | 10 | simandl | # Lineage2 |
286 | | | $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 |
287 | | | $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 |
288 | | | # Teamspeak |
289 | | | $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 |
290 | | | $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 |
291 | 26 | simandl | # L2TP |
292 | | | $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 |
293 | | | $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 |
294 | 27 | simandl | # Americas Army |
295 | | | #UDP |
296 | | | $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 |
297 | | | $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 |
298 | | | $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 |
299 | | | $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 |
300 | | | $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 |
301 | | | $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 |
302 | | | $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 |
303 | | | $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 |
304 | | | #TCP |
305 | | | #14200 |
306 | | | $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 |
307 | | | $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 |
308 | | | #20024 .. 20031 |
309 | | | $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 |
310 | | | $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 |
311 | | | #20032 .. 20047 |
312 | | | $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 |
313 | | | $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 |
314 | | | #20048 |
315 | | | $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 |
316 | | | $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 |
317 | 29 | simandl | # Warhammer Online |
318 | | | #TCP |
319 | | | $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 |
320 | | | $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 |
321 | | | $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 |
322 | | | $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 |
323 | | | #UDP 33100-33500 (32768-33791) |
324 | | | $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 |
325 | | | $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 |
326 | 30 | simandl | #Battlefield 2 |
327 | | | #TCP 16567, 16667 |
328 | 46 | sinda | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 16567 0xffff match ip protocol 0x6 0xff flowid 1:10 |
329 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 16567 0xffff match ip protocol 0x6 0xff flowid 1:10 |
330 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 16667 0xffff match ip protocol 0x6 0xff flowid 1:10 |
331 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 16667 0xffff match ip protocol 0x6 0xff flowid 1:10 |
332 | 30 | simandl | #Call of Duty 4 |
333 | | | #port 28960 TCP a UDP |
334 | 41 | simandl | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 28960 0xffff flowid 1:10 |
335 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 28960 0xffff flowid 1:10 |
336 | | | $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 |
337 | | | $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 |
338 | | | $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 |
339 | | | $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 |
340 | 47 | sinda | # podpora obecne pro PS3 (TCP: 5223, 10070-10080, UDP: 3478-3479, 3658, 3678, 10070-10080) |
341 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 5223 0xffff match ip protocol 0x6 0xff flowid 1:10 |
342 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 5223 0xffff match ip protocol 0x6 0xff flowid 1:10 |
343 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 10070 0xfffe match ip protocol 0x6 0xff flowid 1:10 |
344 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 10070 0xfffe match ip protocol 0x6 0xff flowid 1:10 |
345 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 10072 0xfff8 match ip protocol 0x6 0xff flowid 1:10 |
346 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 10072 0xfff8 match ip protocol 0x6 0xff flowid 1:10 |
347 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 3478 0xfffe match ip protocol 0x11 0xff flowid 1:10 |
348 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 3478 0xfffe match ip protocol 0x11 0xff flowid 1:10 |
349 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 3658 0xffff match ip protocol 0x11 0xff flowid 1:10 |
350 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 3658 0xffff match ip protocol 0x11 0xff flowid 1:10 |
351 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 3678 0xffff match ip protocol 0x11 0xff flowid 1:10 |
352 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 3678 0xffff match ip protocol 0x11 0xff flowid 1:10 |
353 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 10070 0xfffe match ip protocol 0x11 0xff flowid 1:10 |
354 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 10070 0xfffe match ip protocol 0x11 0xff flowid 1:10 |
355 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 10072 0xfff8 match ip protocol 0x11 0xff flowid 1:10 |
356 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 10072 0xfff8 match ip protocol 0x11 0xff flowid 1:10 |
357 | 52 | sinda | # VATSIM Microsoft Flight simulator FS2004 (TCP/UDP 6809, 6073, 3782 a 3290) |
358 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 3290 0xffff flowid 1:10 |
359 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 3290 0xffff flowid 1:10 |
360 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 3782 0xffff flowid 1:10 |
361 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 3782 0xffff flowid 1:10 |
362 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 6073 0xffff flowid 1:10 |
363 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 6073 0xffff flowid 1:10 |
364 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 6809 0xffff flowid 1:10 |
365 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 6809 0xffff flowid 1:10 |
366 | 54 | sinda | # podpora pro hru rFactor (TCP 34447, UDP 34397) |
367 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 34447 0xffff match ip protocol 0x06 0xff flowid 1:10 |
368 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 34447 0xffff match ip protocol 0x06 0xff flowid 1:10 |
369 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 34397 0xffff match ip protocol 0x11 0xff flowid 1:10 |
370 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 34397 0xffff match ip protocol 0x11 0xff flowid 1:10 |
371 | 55 | simandl | # LOTRO - server Snowbourn 41, 114-121 |
372 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip src 94.75.194.41 flowid 1:10 |
373 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dst 94.75.194.41 flowid 1:10 |
374 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip src 94.75.194.112/28 flowid 1:10 |
375 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dst 94.75.194.112/28 flowid 1:10 |
376 | 56 | simandl | # podpora pro hru StarCraft II (TCP UDP 1119) |
377 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 1119 0xffff flowid 1:10 |
378 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 1119 0xffff flowid 1:10 |
379 | 59 | simandl | # podpora pro ts3 (TCP UDP 9987) |
380 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 9987 0xffff flowid 1:10 |
381 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 9987 0xffff flowid 1:10 |
382 | | | # podpora pro ventrilo (TCP UDP 3784) |
383 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 3784 0xffff flowid 1:10 |
384 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 3784 0xffff flowid 1:10 |
385 | 30 | simandl | |
386 | 2 | simandl | # TCP ACK packets smaller than 64 bytes |
387 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 \ |
388 | | | match ip protocol 6 0xff \ |
389 | | | match u8 0x05 0x0f at 0 \ |
390 | | | match u16 0x0000 0xffc0 at 2 \ |
391 | | | match u8 0x10 0xff at 33 \ |
392 | | | flowid 1:10 |
393 | | | |
394 | | | ## Ping class |
395 | | | # ICMP |
396 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip protocol 0x01 0xff flowid 1:20 |
397 | | | |
398 | | | ## Routing class |
399 | | | # BGP |
400 | | | $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 |
401 | | | $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 |
402 | | | # OSPF |
403 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip protocol 0x59 0xff flowid 1:30 |
404 | | | |
405 | 13 | simandl | ## Email & Data transfer class |
406 | 2 | simandl | # FTP |
407 | | | $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 |
408 | | | $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 |
409 | | | # PPTP |
410 | | | $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 |
411 | | | $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 |
412 | | | $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 |
413 | | | $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 |
414 | | | # SCP |
415 | | | $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 |
416 | | | $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 |
417 | | | # POP3 |
418 | 13 | simandl | $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 |
419 | | | $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 |
420 | 2 | simandl | # IMAP |
421 | 13 | simandl | $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 |
422 | | | $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 |
423 | 2 | simandl | # SMTP |
424 | 13 | simandl | $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 |
425 | | | $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 |
426 | 2 | simandl | # POP3S |
427 | 13 | simandl | $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 |
428 | | | $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 |
429 | 2 | simandl | # IMAPS |
430 | 13 | simandl | $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 |
431 | | | $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 |
432 | 2 | simandl | # SSMTP |
433 | 13 | simandl | $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 |
434 | | | $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 |
435 | 2 | simandl | # rsync |
436 | 13 | simandl | $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 |
437 | | | $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 |
438 | | | $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 |
439 | | | $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 |
440 | 2 | simandl | # CVS |
441 | 13 | simandl | $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 |
442 | | | $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 |
443 | | | $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 |
444 | | | $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 |
445 | 39 | simandl | # SVN |
446 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 3690 0xffff flowid 1:40 |
447 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 3690 0xffff flowid 1:40 |
448 | 40 | sinda | # NNTP over SSL |
449 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 563 0xffff flowid 1:40 |
450 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 563 0xffff flowid 1:40 |
451 | | | # VNC |
452 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 5900 0xffff flowid 1:40 |
453 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 5900 0xffff flowid 1:40 |
454 | 2 | simandl | |
455 | 13 | simandl | ## VOIP class |
456 | 33 | simandl | # SIP |
457 | | | $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 |
458 | | | $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 |
459 | | | # RTP |
460 | | | $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 |
461 | | | $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 |
462 | 38 | simandl | # Skype typeofservice mark |
463 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip tos 0x20 0xff flowid 1:50 #Skype? |
464 | 13 | simandl | # VoIP typeofservice mark |
465 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip tos 0x68 0xff flowid 1:50 #SIP |
466 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip tos 0xb8 0xff flowid 1:50 #RTP |
467 | | | # VoIP typeofservice mark for RTP ha-vel.cz |
468 | 38 | simandl | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip tos 0x16 0xff flowid 1:50 #RTP |
469 | 13 | simandl | # TOS mimimize delay - VoIP typeofservice mark for RTP vox.802.cz |
470 | 38 | simandl | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip tos 0x10 0xff flowid 1:50 |
471 | 18 | simandl | # VoIP IP addr for RTP ha-vel.cz |
472 | 53 | sinda | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip src 217.66.161.0/24 flowid 1:50 #RTP |
473 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dst 217.66.161.0/24 flowid 1:50 #RTP |
474 | 18 | simandl | # VoIP IP addr for RTP 802.cz |
475 | 44 | simandl | $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 |
476 | | | $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 |
477 | 50 | simandl | # VoIP IP addr for sip.volny.cz |
478 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip src 195.122.207.107 flowid 1:50 |
479 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dst 195.122.207.107 flowid 1:50 |
480 | 51 | sinda | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip src 195.122.201.50/31 flowid 1:50 |
481 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dst 195.122.201.50/31 flowid 1:50 |
482 | 31 | simandl | # VoIP IP addr for others RTP |
483 | | | $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 |
484 | | | $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 |
485 | 58 | simandl | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip src 213.168.165.12 flowid 1:50 #sip.fayn.cz |
486 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dst 213.168.165.12 flowid 1:50 #sip.fayn.cz |
487 | 31 | simandl | $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 |
488 | | | $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 |
489 | 33 | simandl | $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 |
490 | | | $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 |
491 | 31 | simandl | $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 |
492 | | | $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 |
493 | | | $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 |
494 | | | $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 |
495 | 45 | sinda | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip src 69.59.241.0/24 match ip protocol 0x11 0xff flowid 1:50 # Vonage |
496 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dst 69.59.241.0/24 match ip protocol 0x11 0xff flowid 1:50 # Vonage |
497 | 38 | simandl | $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 |
498 | | | $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 |
499 | 49 | sinda | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip src 195.146.137.186/31 flowid 1:50 # t-com.sk |
500 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dst 195.146.137.186/31 flowid 1:50 # t-com.sk |
501 | 57 | simandl | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip src 213.168.162.0/24 flowid 1:50 # VoIP ipex.cz |
502 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dst 213.168.162.0/24 flowid 1:50 # VoIP ipex.cz |
503 | 33 | simandl | # gnomemeeting |
504 | | | $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 |
505 | | | $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 |
506 | | | $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 |
507 | | | $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 |
508 | | | $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 |
509 | | | $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 |
510 | | | $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 |
511 | | | $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 |
512 | | | $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 |
513 | | | $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 |
514 | | | $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 |
515 | | | $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 |
516 | 34 | simandl | #ventrilo 3784 .. 3791 |
517 | | | $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 |
518 | | | $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 |
519 | 13 | simandl | |
520 | | | ## Web & Squid class |
521 | | | # HTTP |
522 | | | $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 |
523 | | | $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 |
524 | | | # HTTPS |
525 | | | $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 |
526 | | | $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 |
527 | | | # WebCache |
528 | | | $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 |
529 | | | $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 |
530 | 2 | simandl | # HTTP port |
531 | | | $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 |
532 | | | $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 |
533 | | | # ICP port |
534 | | | $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 |
535 | | | $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 |
536 | 33 | simandl | # VPN KB.CZ |
537 | | | $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 |
538 | | | $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 |
539 | 42 | simandl | # Cisco VPN |
540 | 43 | simandl | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 500 0xffff flowid 1:60 |
541 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 500 0xffff flowid 1:60 |
542 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 4500 0xffff flowid 1:60 |
543 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 4500 0xffff flowid 1:60 |
544 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip sport 10000 0xffff flowid 1:60 |
545 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 2 u32 match ip dport 10000 0xffff flowid 1:60 |
546 | 48 | simandl | # OpenVPN |
547 | | | $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:60 |
548 | | | $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:60 |
549 | | | $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:60 |
550 | | | $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:60 |
551 | 2 | simandl | |
552 | 33 | simandl | |
553 | 2 | simandl | ## Unsupported class |
554 | 33 | simandl | # Kazaa |
555 | | | $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 |
556 | | | $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 |
557 | | | |
558 | | | ## Airfree class |
559 | 31 | simandl | # File download over http |
560 | 32 | simandl | $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 |
561 | | | $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 |
562 | | | $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 |
563 | | | $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 |
564 | | | $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 |
565 | | | $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 |
566 | | | $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 |
567 | | | $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 |
568 | | | $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 |
569 | | | $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 |
570 | | | $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 |
571 | 45 | sinda | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 1 u32 match ip src 195.122.149.0/24 flowid 1:667 # TERASPACE-GMBH |
572 | 32 | simandl | $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 |
573 | | | $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 |
574 | | | $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 |
575 | | | $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 |
576 | 35 | simandl | $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 |
577 | 33 | simandl | $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 |
578 | 32 | simandl | $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 |
579 | | | $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 |
580 | | | $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) |
581 | | | $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 |
582 | | | $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 |
583 | | | $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 |
584 | | | $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) |
585 | 31 | simandl | |
586 | 2 | simandl | # IP range of DHCP for airfree AP on this router |
587 | | | for ipaddr in $AIRFREE |
588 | | | do |
589 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 1 u32 match ip src $ipaddr flowid 1:667 |
590 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 1 u32 match ip dst $ipaddr flowid 1:667 |
591 | | | done |
592 | | | # non-CZF-RFC - violators of RFCs |
593 | | | for ipaddr in $NONCZF |
594 | | | do |
595 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 1 u32 match ip src $ipaddr flowid 1:666 |
596 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 1 u32 match ip dst $ipaddr flowid 1:666 |
597 | | | done |
598 | 25 | simandl | # non-contributors |
599 | | | for ipaddr in $NONCONTRIB |
600 | | | do |
601 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 1 u32 match ip src $ipaddr flowid 1:668 |
602 | | | $TC filter add dev ${FACE} parent 1:0 protocol ip prio 1 u32 match ip dst $ipaddr flowid 1:668 |
603 | | | done |
604 | 2 | simandl | |
605 | 4 | simandl | ## Internet class |
606 | 2 | simandl | # IPtables rule |
607 | | | # $IPTABLES -t mangle -A FORWARD -s ! 10.0.0.0/8 -o ${FACE} -j MARK --set-mark 999 |
608 | | | # $IPTABLES -t mangle -A FORWARD -d ! 10.0.0.0/8 -o ${FACE} -j MARK --set-mark 999 |
609 | | | # IPtables mark filter |
610 | | | # $TC filter add dev ${FACE} parent 1:0 protocol ip prio 1 handle 999 fw flowid 1:999 |
611 | | | } |
612 | | | |
613 | | | for FACE in $FACES |
614 | | | do |
615 | 4 | simandl | if [ -z "`$IP l | grep $FACE[:@]`" ] |
616 | | | then |
617 | | | echo "Interface $FACE doesn't exist" |
618 | | | continue |
619 | | | fi |
620 | 2 | simandl | TYPE=`echo -e $IFACECONF | grep $FACE | sed -e "s/^.*{.*type[[:space:]]\+\([[:alpha:]]\+\).*}.*/\1/"` |
621 | | | if [ "$TYPE" != 'transit' ] |
622 | | | then |
623 | | | continue |
624 | | | fi |
625 | | | SPEED=`echo -e $IFACECONF | grep $FACE | sed -e "s/^.*{.*speed[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"` |
626 | | | QUANTUM=`echo -e $IFACECONF | grep $FACE | sed -e "s/^.*{.*quantum[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"` |
627 | | | |
628 | | | if [ -z "$QUANTUM" ] |
629 | | | then |
630 | 4 | simandl | MTU=`$IP l | grep $FACE[:@] | sed -e "s/^.*mtu[[:space:]]\+\([[:digit:]]\+\).*/\1/"` |
631 | 2 | simandl | QUANTUM=$(($QUANTUMOFFS+$MTU)) |
632 | | | fi |
633 | 15 | simandl | |
634 | | | NONCZFSPD=`echo -e $IFACECONF | grep $FACE | sed -e "s/^.*{.*NONCZFSPD[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"` |
635 | | | if [ -z $NONCZFSPD ] ; then NONCZFSPD=$DNONCZFSPD ; fi |
636 | | | |
637 | | | AIRFREESPD=`echo -e $IFACECONF | grep $FACE | sed -e "s/^.*{.*AIRFREESPD[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"` |
638 | | | if [ -z $AIRFREESPD ] ; then AIRFREESPD=$DAIRFREESPD ; fi |
639 | | | |
640 | 25 | simandl | NONCONTRIBSPD=`echo -e $IFACECONF | grep $FACE | sed -e "s/^.*{.*NONCONTRIBSPD[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"` |
641 | | | if [ -z $NONCONTRIBSPD ] ; then NONCONTRIBSPD=$DNONCONTRIBSPD ; fi |
642 | | | |
643 | 15 | simandl | SSHDIV=`echo -e $IFACECONF | grep $FACE | sed -e "s/^.*{.*SSHDIV[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"` |
644 | | | if [ -z $SSHDIV ] ; then SSHDIV=$DSSHDIV ; fi |
645 | | | |
646 | | | PINGDIV=`echo -e $IFACECONF | grep $FACE | sed -e "s/^.*{.*PINGDIV[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"` |
647 | | | if [ -z $PINGDIV ] ; then PINGDIV=$DPINGDIV ; fi |
648 | | | |
649 | | | INTERACTDIV=`echo -e $IFACECONF | grep $FACE | sed -e "s/^.*{.*INTERACTDIV[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"` |
650 | | | if [ -z $INTERACTDIV ] ; then INTERACTDIV=$DINTERACTDIV ; fi |
651 | | | |
652 | | | VOIPDIV=`echo -e $IFACECONF | grep $FACE | sed -e "s/^.*{.*VOIPDIV[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"` |
653 | | | if [ -z $VOIPDIV ] ; then VOIPDIV=$DVOIPDIV ; fi |
654 | | | |
655 | | | WWWDIV=`echo -e $IFACECONF | grep $FACE | sed -e "s/^.*{.*WWWDIV[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"` |
656 | | | if [ -z $WWWDIV ] ; then WWWDIV=$DWWWDIV ; fi |
657 | | | |
658 | | | XFERDIV=`echo -e $IFACECONF | grep $FACE | sed -e "s/^.*{.*XFERDIV[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"` |
659 | | | if [ -z $XFERDIV ] ; then XFERDIV=$DXFERDIV ; fi |
660 | | | |
661 | | | DFLTDIV=`echo -e $IFACECONF | grep $FACE | sed -e "s/^.*{.*DFLTDIV[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"` |
662 | | | if [ -z $DFLTDIV ] ; then DFLTDIV=$DDFLTDIV ; fi |
663 | | | |
664 | | | #echo $SPEED $NONCZFSPD $AIRFREESPD $SSHDIV $PINGDIV $INTERACTDIV $VOIPDIV $WWWDIV $XFERDIV $DFLTDIV |
665 | 2 | simandl | set_qos_classes |
666 | | | done |
667 | | | |
668 | | | exit 0 |