- added informational messages before running iptables-restore
- fixed behaviour of "...-magic-relative-prio 0" + "...-fixed-fixed-prio 0"
- "filter-type classify" prometheus.conf keyword tested in production enviroment
+- log file /var/log/prometheus renamed to /var/log/prometheuslog
+- credit file /var/run/prometheus.credit moved to /var/lib/misc
version 0.7.7 2008-01-??
Prometheus QoS installation - canonical
1. run "./check-kernel-qos" script to check kernel modules HTB and SFQ (optional)
-2. as a root, run "make install" (you shouldn't get errors...)
+2. as a root, run "make install" (you shouldn't get errors, just some warnings)
3. edit /etc/prometheus/prometheus.conf (conf/prometheus.conf or sample-configuration/)
4. edit /etc/prometheus/hosts (conf/prometheus.hosts or sample-configuration/)
5. edit /etc/cron.d/prometheus to update preview, shutdown and reload times
Prometheus QoS installation - alternative, old way
1. if can read read this, you have already unpacked the .tar.gz archive
-2. run "make prometheus" (you shouldn't get errors...)
+2. run "make prometheus" (you shouldn't get errors, just some warnings)
3. create /etc/prometheus/prometheus.conf (conf/prometheus.conf or sample-configuration/)
4. create /etc/prometheus/hosts (conf/prometheus.hosts or sample-configuration/)
5. to activate QoS manualy from command line, just run "./prometheus"
Prometheus Debian packages:
-There are two ways to build Prometheus Debian package (*.deb)
-
-1. as a root access and debhelper package installed, run "make deb"
-2. without root access or debhelper, run "./prometheus.debian-noroot-nodebhelper"
+1. you need root access and "debhelper" package installed
+2. run "make deb" or "sudo make deb"
PACKAGE=prometheus
-VERSION=0.7.7
+VERSION=0.7.8
CFLAGS=-std=c99 -Wall
prefix=/usr
mandir=$(prefix)/share/man
$(CC) -o prometheus prometheus.c
deb: main
- ./prometheus.debian
-
+ arch=`dpkg-architecture -qDEB_HOST_ARCH`
+ maintainer="gandalf <gandalf@arachne.cz>"
+ #patch -Nl <deb/prometheus.patch
+ sed -e "s/__ARCHITECTURE__/$(arch)/" -e "s/__VERSION__/($VERSION)/" -e "s/__PACKAGE__/($PACKAGE)/" -e "s/__MAINTAINER__/$(maintainer)/" deb/prometheus.control > deb/control
+ dpkg-buildpackage
+
+tgz: clean
+ cp -r . ../$(PACKAGE)-$(VERSION)
+ rm -rf ../$(PACKAGE)-$(VERSION)/.svn/
+ rm -rf ../$(PACKAGE)-$(VERSION)/*/.svn/
+ rm -rf ../$(PACKAGE)-$(VERSION)/*~ $(PACKAGE)-$(VERSION)/*/*~
+ tar -czf $(PACKAGE)-$(VERSION).tar.gz ../$(PACKAGE)-$(VERSION)
+ rm -rf ../$(PACKAGE)-$(VERSION)
+
install: main
install -d $(sbindir)
install -d $(mandir)/man1
clean:
rm -f prometheus
+ rm -f optinal-tools/prometheus-stats
Prometheus QoS - steal fire from your ISP !
"fair-per-IP" quality of service utility
requires Linux kernel with HTB qdisc enabled
-GNU+ Copyright(G)2007, Michael Polak (xChaos)
-Credits: Credits: CZFree.Net, Netdave, aquarius
-...and Martin Devera (.cz) for his HTB qdisc (of course)
-...and Jakub Walczak (.pl) for providing feedback and patches
-...and Ing. Jiri Engelthaler (.cz) for bugfixes and Asus WL500 port
-...and Dial Telecom (slightly expensive ISP) for chance to test it
+
+Copyright(C) 2005-2008 Michael Polak (xChaos) original source code
+Copyright(C) 2007-2008 Martin Svoboda (Ludva) iptables-restore, CLASSIFY
+
+Credit: CZFree.Net+Netdave (idea), Aquarius (.rpm), Gandalf (.deb)
+...and: Martin Devera (.cz) for his HTB qdisc (of course)
+...and: Jakub Walczak (.pl) for providing feedback and patches
+...and: Ing. Jiri Engelthaler (.cz) for bugfixes and Asus WL500 port
+...and: Dial Telecom (our slightly expensive ISP) for chance to test it
Feedback: xchaos(at)arachne.cz
Homepage: http://gpl.arachne.cz
-
+SVN tree: https://dev.arachne.cz/svn/prometheus
============================================================================
QoS (or Quality-of-service) is IPv4 traffic shaper replacement for Internet
#==========================================================================
#Credit file settings - stores unused credit from previous runs
#--------------------------------------------------------------------------
-credit-filename /var/run/prometheus.credit
+credit-filename /var/lib/misc/prometheus.credit
credit-enable 1 #1=yes|0=no
#==========================================================================
#Log file names and directories
#--------------------------------------------------------------------------
-log-filename /var/log/prometheus
+log-filename /var/log/prometheuslog
log-traffic-directory /var/www/logs/
log-traffic-url-path logs/
#==========================================================================
--- /dev/null
+/etc/prometheus/prometheus.conf
+/etc/prometheus/hosts
+/etc/cron.d/prometheus
It was downloaded from https://dev.arachne.cz/svn/prometheus/downloads
-Copyright: GNU+ Copyright(G)2007, Michael Polak (xChaos)
-Credits: CZFree.Net, Netdave, aquarius
- ...and Martin Devera (.cz) for his HTB qdisc (of course)
- ...and Jakub Walczak (.pl) for providing feedback and patches
- ...and Ing. Jiri Engelthaler (.cz) for bugfixes and Asus WL500 port
- ...and Dial Telecom (slightly expensive ISP) for chance to test it
-
+Copyright(C) 2005-2008 Michael Polak (xChaos) original source code
+Copyright(C) 2007-2008 Martin Svoboda (Ludva) iptables-restore, CLASSIFY
+
+Credit: CZFree.Net+Netdave (idea), Aquarius (.rpm), Gandalf (.deb)
+...and: Martin Devera (.cz) for his HTB qdisc (of course)
+...and: Jakub Walczak (.pl) for providing feedback and patches
+...and: Ing. Jiri Engelthaler (.cz) for bugfixes and Asus WL500 port
+...and: Dial Telecom (our slightly expensive ISP) for chance to test it
License:
+++ /dev/null
---- prometheus.c 2008-01-09 12:38:16.000000000 +0100
-+++ prometheus.c.deb 2008-01-09 15:51:48.098924554 +0100
-@@ -60,9 +60,9 @@
- char *config="/etc/prometheus/prometheus.conf"; /* main configuration file */\r
- char *hosts="/etc/prometheus/hosts"; /* line bandwidth definition file */\r
- char *tc="/sbin/tc"; /* requires tc with HTB support */\r
--char *iptables="/usr/sbin/iptables"; /* requires iptables utility */\r
--char *iptablessave="/usr/sbin/iptables-save"; /* new */\r
--char *iptablesrestore="/usr/sbin/iptables-restore"; /* new */\r
-+char *iptables="/sbin/iptables"; /* requires iptables utility */\r
-+char *iptablessave="/sbin/iptables-save"; /* new */\r
-+char *iptablesrestore="/sbin/iptables-restore"; /* new */\r
- char *iptablesfile="/var/spool/prometheus.iptables"; /* new; file for iptables-restore*/\r
- char *iptablespreamble="*mangle\n:PREROUTING ACCEPT [0:0]\n:POSTROUTING ACCEPT [0:0]\n:INPUT ACCEPT [0:0]\n:OUTPUT ACCEPT [0:0]\n:FORWARD ACCEPT [0:0]";\r
- FILE *iptables_file=NULL;\r
-@@ -72,7 +72,7 @@
- char *credit="/var/run/prometheus.credit"; /* credit log file */\r
- int enable_credit=1; /* enable credit file */\r
- int use_credit=0; /* use credit file (if enabled)*/\r
--char *log_dir="/var/www/html/logs/"; /* log directory pathname */\r
-+char *log_dir="/var/www/logs/"; /* log directory pathname */\r
- char *log_url="logs/"; /* log directory URL prefix */\r
- char *title="Hall of Fame - Greatest Suckers"; /* hall of fame title */\r
- int hall_of_fame=1; /* enable hall of fame */\r
bindir = /usr/sbin
mandir = /usr/share/man
sysconfdir = /etc
-destdir = $(CURDIR)/debian/prometheus
+destdir = $(CURDIR)/deb/prometheus
docdir = /usr/share/doc
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
build-stamp:
dh_testdir
$(CC) -o $(CURDIR)/prometheus $(CURDIR)/prometheus.c
-# $(CC) -o $(CURDIR)/prometheus-monthly-stats $(CURDIR)/optional-tools/monthly-stats.c
+# $(CC) -o $(CURDIR)/prometheus-stats $(CURDIR)/optional-tools/prometheus-stats.c
touch $@
dh_clean -k
dh_installdirs
install -m 755 -o root -g root $(CURDIR)/prometheus $(destdir)$(bindir)
-# install -m 755 -o root -g root $(CURDIR)prometheus-monthly-stats $(destdir)$(bindir)
+# install -m 755 -o root -g root $(CURDIR)/prometheus-stats $(destdir)$(bindir)
install -m 644 -o root -g root $(CURDIR)/prometheus.1 $(destdir)$(mandir)/man1
install -m 644 -o root -g root $(CURDIR)/prometheus.conf.5 $(destdir)$(mandir)/man5
install -m 755 -o root -g root $(CURDIR)/conf/prometheus.init $(destdir)$(sysconfdir)/init.d/prometheus
/* == Credit: CZFree.Net,Martin Devera,Netdave,Aquarius,Gandalf == */\r
/* =============================================================== */\r
\r
-/* Modified: xChaos, 20080201\r
+/* Modified: xChaos, 20080202\r
ludva, 20071227\r
\r
Prometheus QoS is free software; you can redistribute it and/or\r
\r
const char *version="0.7.8"; /*0.7.9 will be last development, 0.8.0 first stable */\r
\r
+/* ======= All path names are defined hear (for RPM patch) ======= */\r
+\r
+char *tc = "/sbin/tc"; /* requires tc with HTB support */\r
+char *iptables = "/sbin/iptables"; /* requires iptables utility */\r
+char *iptablessave = "/sbin/iptables-save"; /* not yet required */\r
+char *iptablesrestore = "/sbin/iptables-restore"; /* requires iptables-restore */\r
+\r
+char *config = "/etc/prometheus/prometheus.conf"; /* main configuration file */\r
+char *hosts = "/etc/prometheus/hosts"; /* per-IP bandwidth definition file */\r
+\r
+char *iptablesfile = "/var/spool/prometheus.iptables"; /* temporary file for iptables-restore*/\r
+char *credit = "/var/lib/misc/prometheus.credit"; /* credit log file */\r
+char *html = "/var/www/traffic.html"; /* hall of fame filename */\r
+char *preview = "/var/www/preview.html"; /* hall of fame preview */\r
+char *cmdlog = "/var/log/prometheuslog"; /* command log filename */\r
+char *log_dir = "/var/www/logs/"; /* log directory pathname, ended with slash */\r
+char *log_url = "logs/"; /* log directory relative URI prefix (partial URL) */\r
+\r
/* ======= Help screen is hopefuly self-documenting part of code :-) ======= */\r
\r
void help(void)\r
char *mark="MARK";\r
char *mark_iptables="MARK --set-mark ";\r
int dry_run=0; /* preview - use puts() instead of system() */\r
-char *config="/etc/prometheus/prometheus.conf"; /* main configuration file */\r
-char *hosts="/etc/prometheus/hosts"; /* line bandwidth definition file */\r
-char *tc="/sbin/tc"; /* requires tc with HTB support */\r
-char *iptables="/sbin/iptables"; /* requires iptables utility */\r
-char *iptablessave="/sbin/iptables-save"; /* new */\r
-char *iptablesrestore="/sbin/iptables-restore"; /* new */\r
-char *iptablesfile="/var/spool/prometheus.iptables"; /* new; file for iptables-restore*/\r
char *iptablespreamble="*mangle\n:PREROUTING ACCEPT [0:0]\n:POSTROUTING ACCEPT [0:0]\n:INPUT ACCEPT [0:0]\n:OUTPUT ACCEPT [0:0]\n:FORWARD ACCEPT [0:0]";\r
FILE *iptables_file=NULL;\r
-char *html="/var/www/traffic.html"; /* hall of fame filename */\r
-char *preview="/var/www/preview.html"; /* hall of fame preview */\r
-char *cmdlog="/var/log/prometheus"; /* command log filename */\r
-char *credit="/var/run/prometheus.credit"; /* credit log file */\r
int enable_credit=1; /* enable credit file */\r
int use_credit=0; /* use credit file (if enabled)*/\r
-char *log_dir="/var/www/logs/"; /* log directory pathname */\r
-char *log_url="logs/"; /* log directory URL prefix */\r
char *title="Hall of Fame - Greatest Suckers"; /* hall of fame title */\r
int hall_of_fame=1; /* enable hall of fame */\r
char *lan="eth0"; /* LAN interface */\r
\r
save_line("COMMIT");\r
fclose(iptables_file);\r
- if(dry_run) {\r
+ if(dry_run) \r
+ {\r
parse(iptablesfile)\r
{\r
str=_;\r
printf("%s\n", str);\r
}done;\r
- }else{\r
- //sprintf(restor,"cat %s",iptablesfile); else \r
- sprintf(restor,"%s <%s",iptablesrestore, iptablesfile);\r
- system(restor);\r
- };\r
+ }\r
+\r
+ sprintf(restor,"%s <%s",iptablesrestore, iptablesfile);\r
+ safe_run(restor);\r
\r
free(restor);\r
}\r
package=`grep PACKAGE Makefile | gawk -F= '{ print $2 }'`
maintainer='gandalf <gandalf@arachne.cz>'
-patch -Nl <debian/prometheus.patch
+#patch -Nl <debian/prometheus.patch
sed -e "s/__ARCHITECTURE__/$arch/" \
-e "s/__VERSION__/$version/" \
or remote management of entire network after ssh to gatway and then another
ssh to this zone.
-We run HTTP proxy at port 3128 of LAN interface of internet gateway. This
-proxy is inside "qos-free-zone". Because of "qos-proxy-enable",
+We used to run HTTP proxy at port 3128 of LAN interface of internet gateway.
+This proxy was inside "qos-free-zone". With "qos-proxy-enable",
"qos-proxy-ip" (which is actually IP/number of bits of netmask) and
-"qos-proxy-port" settings, this port is excluded from QoS-free zone.
+"qos-proxy-port" settings, this port was excluded from QoS-free zone.
3) NAT
# Poznamky a komentare, ktere zpracovava primo Prometheus QoS:
#
# wifi-normal-128-MAX wifi pripojeni s FUP 2 GB/48h
-# wifi-plus-256-MAX wifi pripojeni s FUP 6 GB/48h
-# backbone-normal-128-MAX paterni pripojeni s FUP 3 GB/48h
-# backbone-plus-MIN-MAX paterni pripojeni s mirnejsim FUP
+# wifi-plus-256-MAX wifi pripojeni s FUP 4 GB/48h
+# backbone-normal-128-MAX paterni pripojeni s FUP 4 GB/48h
+# backbone-plus-MIN-MAX paterni pripojeni s FUP 4 GB/48h
# backbone-bezfup-MIN-MAX paterni pripojeni bez FUP, s nizsi prioritou
# sharing-hostname sdileni konektivity, pozor - nelze pouzit aliasy
#==========================================================================
-#
-# Prometheus QoS - steal fire from your ISP !
-# "fair-per-IP" quality of service utility
-# requires Linux kernel with HTB qdisc enabled
-# GNUpyright(G)2007 Michael xChaos Polak, x@n.cz
-# Credits: CZFree.Net / Freegate / Deu / d@n.cz
-# ...and Martin Devera for his HTB, of course ;-)
-#
+#Configuration for Arachne Labs gateway prometheus.brevnov.czf (10.11.10.1)
#==========================================================================
#Path to external utilities required to run iGW Prometheus:
#--------------------------------------------------------------------------
tc /sbin/tc
iptables /sbin/iptables
+iptables-restore /sbin/iptables-restore
+#==========================================================================
+#Filename of iptables mangle table for iptables-restore
+#--------------------------------------------------------------------------
+iptables-file /var/spool/prometheus.iptables
#==========================================================================
#Filename of /etc/hosts - style IP address configuration file
#--------------------------------------------------------------------------
#guranted upload and download bandwidth FROM your ISP (in kbps, please!)
#asymetry settings will be automaticaly calculated from these values
#--------------------------------------------------------------------------
-wan-download 40000 #kbps
-wan-upload 40000 #kbps
+wan-download 40960 #kbps
+wan-upload 40960
#==========================================================================
#special QoS free zone (eg. free CZFree tranzit, etc.)
#Apply QoS on HTTP proxy IP addres/port
wifi-normal-asymetry-treshold 0 #kbps
wifi-plus-asymetry-ratio 1
wifi-plus-asymetry-treshold 0
-backbone-normal-asymetry-ratio 1
+backbone-normal-asymetry-ratio 1
backbone-normal-asymetry-treshold 0
backbone-plus-asymetry-ratio 1
backbone-plus-asymetry-treshold 0
backbone-bezfup-asymetry-treshold 0
#==========================================================================
#HTB fine tuning part I - common settings
+#type of traffic filtering mark&filter or classify (without tc filter)
#--------------------------------------------------------------------------
htb-nesting-limit 3 #0..4: HTB seems to have built-in limit
htb-burst 32 #kbit
+htb-burst-group 32 #kbit (group level classes)
+htb-burst-main 64 #kbit (medium&line level classes - 1:1, 1:2)
htb-leaf-discipline sfq perturb 5
+filter-type classify #or mark
#==========================================================================
#magic-include-upload - is data counter sum of upload and download ?
#magic-priorities - prioty levels are used by magic-relative-prio
#These settings are keyword-derived ! (see "keyword" section)
#--------------------------------------------------------------------------
wifi-normal-magic-relative-limit 8 #*kb/sec->MB/day
-wifi-normal-magic-relative-prio 6 #*kb/sec->MB/day
+wifi-normal-magic-relative-prio 4 #*kb/sec->MB/day
wifi-normal-magic-fixed-limit 0 #MB, less then
wifi-normal-magic-fixed-prio 0 #MB, less then
-wifi-plus-magic-relative-limit 12
+wifi-plus-magic-relative-limit 16
wifi-plus-magic-relative-prio 8
wifi-plus-magic-fixed-limit 0
wifi-plus-magic-fixed-prio 0
-backbone-normal-magic-relative-limit 12
+backbone-normal-magic-relative-limit 16
backbone-normal-magic-relative-prio 8
backbone-normal-magic-fixed-limit 0
backbone-normal-magic-fixed-prio 0
-backbone-plus-magic-relative-limit 16
-backbone-plus-magic-relative-prio 12
+backbone-plus-magic-relative-limit 32
+backbone-plus-magic-relative-prio 16
backbone-plus-magic-fixed-limit 0
backbone-plus-magic-fixed-prio 0
backbone-bezfup-magic-relative-limit 0
#==========================================================================
#Credit file settings - stores unused credit from previous runs
#--------------------------------------------------------------------------
-credit-filename /var/run/prometheus.credit
+credit-filename /var/lib/misc/prometheus.credit
credit-enable 1 #1=yes|0=no
#==========================================================================
#Log file names and directories
#--------------------------------------------------------------------------
-log-filename /var/log/prometheus
+log-filename /var/log/prometheuslog
log-traffic-directory /var/www/logs/
log-traffic-url-path logs/
#==========================================================================