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 |
14 | iptables /sbin/iptables |
15 | #========================================================================== |
16 | #Filename of /etc/hosts - style IP address configuration file |
17 | #-------------------------------------------------------------------------- |
18 | hosts /etc/prometheus.hosts |
19 | #========================================================================== |
20 | #Keywords found in /etc/host comments - syntax KEYWORD-MIN-MAX |
21 | #Eg.: 192.168.1.2 mypc #via-prometheus-256-512 |
22 | #sets HTB rate for 192.168.1.2 to 256 kbps and HTB ceil to 512 kbps |
23 | #-------------------------------------------------------------------------- |
24 | keyword via-prometheus |
25 | keyword adsl-prometheus |
26 | #========================================================================== |
27 | #LAN (local, downstream) and WAN (isp, internet, upstream) interface names |
28 | #didn't work well with only one interface - two interfaces are required now |
29 | #-------------------------------------------------------------------------- |
30 | lan-interface eth0 #Linux network interface name |
31 | wan-interface eth1 #Linux network interface name |
32 | #========================================================================== |
33 | #LAN and WAN medium definition (100Mbit, 10Mbit - use 2Mbit for Wi-Fi) |
34 | #-------------------------------------------------------------------------- |
35 | lan-medium 100Mbit #Mbit|kbit |
36 | wan-medium 100Mbit #Mbit|kbit |
37 | #========================================================================== |
38 | #guranted upload and download bandwidth FROM your ISP (in kbps, please!) |
39 | #asymetry settings will be automaticaly calculated from these values |
40 | #-------------------------------------------------------------------------- |
41 | wan-download 10000 #kbps |
42 | wan-upload 10000 #kbps |
43 | #========================================================================== |
44 | #special QoS free zone (eg. free CZFree tranzit, etc.) |
45 | #Apply QoS on HTTP proxy IP addres/port |
46 | #Set HTB rate and HTB ceil for address undefined in hosts file |
47 | #-------------------------------------------------------------------------- |
48 | qos-free-zone 10.0.0.0/8 #0=disable|subnet eg. 192.168.0.0/16 |
49 | qos-free-delay 14400 #seconds to wait before applying QoS |
50 | qos-proxy-enable 0 #1=yes|0=no |
51 | qos-proxy-ip 10.11.10.1/32 #eg. IP of our LAN interface |
52 | qos-proxy-port 3128 #squid port |
53 | free-rate 64 #kbps - by Vitex kuli testovani dashboardu |
54 | free-ceil 128 #kbps |
55 | digital-divide-weirdness-ratio 1 #can be 1, 2, 3, maybe even more... |
56 | #========================================================================== |
57 | #Asymetric line settings - this allows setup of ADSL-style ISP service |
58 | #asymetry-rate 2 means upload is limited to 50% of the rate of download |
59 | #asymetry-treshold 64 means upload will be 64 kbps slower then download |
60 | #-------------------------------------------------------------------------- |
61 | #These settings are keyword-derived ! (see "keyword" section) |
62 | #-------------------------------------------------------------------------- |
63 | via-prometheus-asymetry-ratio 1 #2,4,etc. for relative upload shaping |
64 | via-prometheus-asymetry-treshold 0 #kbps |
65 | adsl-prometheus-asymetry-ratio 2 |
66 | adsl-prometheus-asymetry-treshold 0 |
67 | #========================================================================== |
68 | #HTB fine tuning part I - common settings |
69 | #-------------------------------------------------------------------------- |
70 | htb-nesting-limit 3 #0..4: HTB seems to have built-in limit |
71 | htb-burst 32 #kbit |
72 | htb-leaf-discipline sfq perturb 5 |
73 | #========================================================================== |
74 | #magic-include-upload - is data counter sum of upload and download ? |
75 | #magic-priorities - prioty levels are used by magic-relative-prio |
76 | #magic-treshold - heaviest downloader: htb-rate, 2nd: htb-rate+magic-treshold |
77 | #========================================================================== |
78 | magic-include-upload 1 #1=yes|0=no |
79 | magic-priorities 8 #number of priority levels - 2 |
80 | magic-treshold 2 #kbps |
81 | #-------------------------------------------------------------------------- |
82 | #Magic data limit based od guaranted bandwidth in kbps fine tunes HTB ceil: |
83 | #(magic-relative-limit)*(min bandwidth kbps) = limit for given time period |
84 | #eg. value 8 gives 512 MB limit to 64 kbps HTB rates, 1024 MB to 128'ers... |
85 | #magic-fixed-limit is fixed data limit in MB (megabytes), 0=no limit |
86 | #HTB ceil will be reduced to (HTB rate) for the most unfair-users |
87 | #other offenders get (HTB rate)+(magic-treshold) |
88 | #magic-relative-prio and magic-fixed-prio work exactly the same way as |
89 | #limit, except that they reduce HTB priority instead of HTB ceil |
90 | #-------------------------------------------------------------------------- |
91 | #These settings are keyword-derived ! (see "keyword" section) |
92 | #-------------------------------------------------------------------------- |
93 | via-prometheus-magic-relative-limit 8 #*kb/sec->MB/day |
94 | via-prometheus-magic-relative-prio 6 #*kb/sec->MB/day |
95 | via-prometheus-magic-fixed-limit 0 #MB, less then |
96 | via-prometheus-magic-fixed-prio 0 #MB, less then |
97 | adsl-prometheus-magic-relative-limit 12 |
98 | adsl-prometheus-magic-relative-prio 8 |
99 | adsl-prometheus-magic-fixed-limit 0 |
100 | adsl-prometheus-magic-fixed-prio 0 |
101 | #========================================================================== |
102 | #HTB fine tuning part II - keyword dependent settings |
103 | #-------------------------------------------------------------------------- |
104 | #These settings are keyword-derived ! (see "keyword" section) |
105 | #-------------------------------------------------------------------------- |
106 | via-prometheus-htb-default-prio 1 #can be 1...magic-priorities-2 |
107 | via-prometheus-htb-rate-bonus 0 #kbps |
108 | via-prometheus-htb-ceil-malus 0 #kbps |
109 | adsl-prometheus-htb-default-prio 1 |
110 | adsl-prometheus-htb-rate-bonus 16 |
111 | adsl-prometheus-htb-ceil-malus 0 |
112 | #========================================================================== |
113 | #Credit file settings - stores unused credit from previous runs |
114 | #-------------------------------------------------------------------------- |
115 | credit-filename /var/run/prometheus.credit |
116 | credit-enable 1 #1=yes|0=no |
117 | #========================================================================== |
118 | #Log file names and directories |
119 | #-------------------------------------------------------------------------- |
120 | log-filename /var/log/prometheus |
121 | log-traffic-directory /var/www/logs/ |
122 | log-traffic-url-path logs/ |
123 | #========================================================================== |
124 | #Hall of Fame - Greatest Suckers settings |
125 | #-------------------------------------------------------------------------- |
126 | hall-of-fame-enable 1 #1=yes|0=no |
127 | hall-of-fame-filename /var/www/yesterday.html |
128 | hall-of-fame-preview /var/www/today.html |
129 | hall-of-fame-title Hall of Fame - Greatest Suckers |
130 | #========================================================================== |
131 | #Hall of Fame - Color settings (for FUP data limit display) |
132 | #-------------------------------------------------------------------------- |
133 | #These settings are keyword-derived ! (see "keyword" section) |
134 | #-------------------------------------------------------------------------- |
135 | via-prometheus-html-color 008000 |
136 | adsl-prometheus-html-color 000080 |
137 | #========================================================================== |
138 | #That's all, folks. Now just run /usr/local/sbin/prometheus every day... |