a4f661fc |
1 | #========================================================================== |
2 | # |
3 | # Prometheus QoS - steal fire from your ISP ! |
4 | # "fair-per-IP" quality of service utility |
5 | # requires Linux kernel with HTB qdisc enabled |
6 | # GNUpyright(G)2007 Michael xChaos Polak, x@n.cz |
7 | # Credits: CZFree.Net / Freegate / Deu / d@n.cz |
8 | # ...and Martin Devera for his HTB, of course ;-) |
9 | # |
10 | #========================================================================== |
11 | #Path to external utilities required to run iGW Prometheus: |
12 | #-------------------------------------------------------------------------- |
13 | tc /sbin/tc |
ec04fc0f |
14 | iptables /sbin/iptables |
15 | iptables-restore /sbin/iptables-restore |
e0161edb |
16 | #========================================================================== |
17 | #Filename of iptables mangle table for iptables-restore |
18 | #-------------------------------------------------------------------------- |
19 | iptables-file /var/spool/prometheus.iptables |
a4f661fc |
20 | #========================================================================== |
21 | #Filename of /etc/hosts - style IP address configuration file |
22 | #-------------------------------------------------------------------------- |
5def4ce3 |
23 | hosts /etc/prometheus/hosts |
a4f661fc |
24 | #========================================================================== |
25 | #Keywords found in /etc/host comments - syntax KEYWORD-MIN-MAX |
26 | #Eg.: 192.168.1.2 mypc #via-prometheus-256-512 |
27 | #sets HTB rate for 192.168.1.2 to 256 kbps and HTB ceil to 512 kbps |
28 | #-------------------------------------------------------------------------- |
29 | keyword via-prometheus |
30 | keyword adsl-prometheus |
31 | #========================================================================== |
32 | #LAN (local, downstream) and WAN (isp, internet, upstream) interface names |
33 | #didn't work well with only one interface - two interfaces are required now |
34 | #-------------------------------------------------------------------------- |
35 | lan-interface eth0 #Linux network interface name |
36 | wan-interface eth1 #Linux network interface name |
37 | #========================================================================== |
38 | #LAN and WAN medium definition (100Mbit, 10Mbit - use 2Mbit for Wi-Fi) |
39 | #-------------------------------------------------------------------------- |
40 | lan-medium 100Mbit #Mbit|kbit |
41 | wan-medium 100Mbit #Mbit|kbit |
42 | #========================================================================== |
43 | #guranted upload and download bandwidth FROM your ISP (in kbps, please!) |
44 | #asymetry settings will be automaticaly calculated from these values |
45 | #-------------------------------------------------------------------------- |
46 | wan-download 10000 #kbps |
47 | wan-upload 10000 #kbps |
48 | #========================================================================== |
49 | #special QoS free zone (eg. free CZFree tranzit, etc.) |
50 | #Apply QoS on HTTP proxy IP addres/port |
51 | #Set HTB rate and HTB ceil for address undefined in hosts file |
52 | #-------------------------------------------------------------------------- |
53 | qos-free-zone 10.0.0.0/8 #0=disable|subnet eg. 192.168.0.0/16 |
54 | qos-free-delay 14400 #seconds to wait before applying QoS |
55 | qos-proxy-enable 0 #1=yes|0=no |
56 | qos-proxy-ip 10.11.10.1/32 #eg. IP of our LAN interface |
57 | qos-proxy-port 3128 #squid port |
58 | free-rate 64 #kbps - by Vitex kuli testovani dashboardu |
59 | free-ceil 128 #kbps |
60 | digital-divide-weirdness-ratio 1 #can be 1, 2, 3, maybe even more... |
61 | #========================================================================== |
62 | #Asymetric line settings - this allows setup of ADSL-style ISP service |
63 | #asymetry-rate 2 means upload is limited to 50% of the rate of download |
64 | #asymetry-treshold 64 means upload will be 64 kbps slower then download |
65 | #-------------------------------------------------------------------------- |
66 | #These settings are keyword-derived ! (see "keyword" section) |
67 | #-------------------------------------------------------------------------- |
68 | via-prometheus-asymetry-ratio 1 #2,4,etc. for relative upload shaping |
69 | via-prometheus-asymetry-treshold 0 #kbps |
70 | adsl-prometheus-asymetry-ratio 2 |
71 | adsl-prometheus-asymetry-treshold 0 |
72 | #========================================================================== |
73 | #HTB fine tuning part I - common settings |
74 | #-------------------------------------------------------------------------- |
75 | htb-nesting-limit 3 #0..4: HTB seems to have built-in limit |
e0161edb |
76 | htb-burst 8 #kbit (ip level classes) |
77 | htb-burst-group 32 #kbit (group level classes) |
78 | htb-burst-main 64 #kbit (medium&line level classes - 1:1, 1:2) |
79 | htb-leaf-discipline sfq perturb 5 #maybe "none" |
80 | htb-r2q 1 |
81 | #type filtering traffic: mark&filter or classify (without tc filter) |
82 | filter-type classify #or mark |
a4f661fc |
83 | #========================================================================== |
84 | #magic-include-upload - is data counter sum of upload and download ? |
a4f661fc |
85 | #magic-treshold - heaviest downloader: htb-rate, 2nd: htb-rate+magic-treshold |
86 | #========================================================================== |
87 | magic-include-upload 1 #1=yes|0=no |
a4f661fc |
88 | magic-treshold 2 #kbps |
89 | #-------------------------------------------------------------------------- |
90 | #Magic data limit based od guaranted bandwidth in kbps fine tunes HTB ceil: |
91 | #(magic-relative-limit)*(min bandwidth kbps) = limit for given time period |
92 | #eg. value 8 gives 512 MB limit to 64 kbps HTB rates, 1024 MB to 128'ers... |
93 | #magic-fixed-limit is fixed data limit in MB (megabytes), 0=no limit |
94 | #HTB ceil will be reduced to (HTB rate) for the most unfair-users |
95 | #other offenders get (HTB rate)+(magic-treshold) |
96 | #magic-relative-prio and magic-fixed-prio work exactly the same way as |
97 | #limit, except that they reduce HTB priority instead of HTB ceil |
98 | #-------------------------------------------------------------------------- |
99 | #These settings are keyword-derived ! (see "keyword" section) |
100 | #-------------------------------------------------------------------------- |
101 | via-prometheus-magic-relative-limit 8 #*kb/sec->MB/day |
102 | via-prometheus-magic-relative-prio 6 #*kb/sec->MB/day |
103 | via-prometheus-magic-fixed-limit 0 #MB, less then |
104 | via-prometheus-magic-fixed-prio 0 #MB, less then |
105 | adsl-prometheus-magic-relative-limit 12 |
106 | adsl-prometheus-magic-relative-prio 8 |
107 | adsl-prometheus-magic-fixed-limit 0 |
108 | adsl-prometheus-magic-fixed-prio 0 |
109 | #========================================================================== |
110 | #HTB fine tuning part II - keyword dependent settings |
111 | #-------------------------------------------------------------------------- |
112 | #These settings are keyword-derived ! (see "keyword" section) |
113 | #-------------------------------------------------------------------------- |
208112af |
114 | via-prometheus-htb-default-prio 1 #can be 1...7 |
a4f661fc |
115 | via-prometheus-htb-rate-bonus 0 #kbps |
116 | via-prometheus-htb-ceil-malus 0 #kbps |
208112af |
117 | adsl-prometheus-htb-default-prio 1 |
a4f661fc |
118 | adsl-prometheus-htb-rate-bonus 16 |
e0161edb |
119 | adsl-prometheus-htb-ceil-malus 0 |
120 | #========================================================================== |
121 | #HTB fine tuning part III - keyword dependent settings |
122 | #-------------------------------------------------------------------------- |
123 | #These settings are keyword-derived ! (see "keyword" section) |
124 | # optionally! if not defined, using global leaf-discipline |
125 | # value "none" skip qdisc creation for this keyword |
126 | #-------------------------------------------------------------------------- |
127 | #via-prometheus-leaf-leaf-discipline esfq |
128 | #adsl-prometheus-leaf-discipline none |
a4f661fc |
129 | #========================================================================== |
130 | #Credit file settings - stores unused credit from previous runs |
131 | #-------------------------------------------------------------------------- |
ae776b10 |
132 | credit-filename /var/lib/misc/prometheus.credit |
a4f661fc |
133 | credit-enable 1 #1=yes|0=no |
134 | #========================================================================== |
135 | #Log file names and directories |
136 | #-------------------------------------------------------------------------- |
5b902402 |
137 | log-filename /var/log/prometheuslog |
138 | log-traffic-directory /var/www/logs/ |
139 | log-traffic-html-directory /var/www/logs/html/ |
6cc38f96 |
140 | #========================================================================== |
141 | #URLs of external resources |
142 | #-------------------------------------------------------------------------- |
8bcc3268 |
143 | log-traffic-url-path /logs/ |
6cc38f96 |
144 | jquery-url http://code.jquery.com/jquery-latest.js |
145 | lms-url /lms/?m=customerinfo&id= |
146 | use-jquery-popups 1 |
a4f661fc |
147 | #========================================================================== |
148 | #Hall of Fame - Greatest Suckers settings |
149 | #-------------------------------------------------------------------------- |
150 | hall-of-fame-enable 1 #1=yes|0=no |
151 | hall-of-fame-filename /var/www/yesterday.html |
152 | hall-of-fame-preview /var/www/today.html |
153 | hall-of-fame-title Hall of Fame - Greatest Suckers |
154 | #========================================================================== |
155 | #Hall of Fame - Color settings (for FUP data limit display) |
156 | #-------------------------------------------------------------------------- |
157 | #These settings are keyword-derived ! (see "keyword" section) |
158 | #-------------------------------------------------------------------------- |
159 | via-prometheus-html-color 008000 |
160 | adsl-prometheus-html-color 000080 |
161 | #========================================================================== |
162 | #That's all, folks. Now just run /usr/local/sbin/prometheus every day... |