892
edits
Line 15: | Line 15: | ||
* [http://wiki.openwrt.org/doc/howto/bwmon iftop], [http://www.ex-parrot.com/pdw/iftop/ man page] - "iftop does for network usage what top(1) does for CPU usage. It listens to network traffic on a named interface and displays a table of current bandwidth usage by pairs of hosts." | * [http://wiki.openwrt.org/doc/howto/bwmon iftop], [http://www.ex-parrot.com/pdw/iftop/ man page] - "iftop does for network usage what top(1) does for CPU usage. It listens to network traffic on a named interface and displays a table of current bandwidth usage by pairs of hosts." | ||
=== ipt-account == | === ipt-account === | ||
[https://code.google.com/p/ipt-account/ ipt-account] is an iptables module capable of recording e.g. traffic usage on different interfaces and subnets. This is what the EFF open wireless router uses. They currently use a [https://github.com/EFForg/OpenWireless/blob/0785708984cdae7ebf9ae83ae8d1d278d3a1d4fb/routerapi/get_bytecounts.py python script] that calls the iptaccount command to get usage info and display it in the browser. It is | [https://code.google.com/p/ipt-account/ ipt-account] is an iptables module capable of recording e.g. traffic usage on different interfaces and subnets. This is what the EFF open wireless router uses. They currently use a [https://github.com/EFForg/OpenWireless/blob/0785708984cdae7ebf9ae83ae8d1d278d3a1d4fb/routerapi/get_bytecounts.py python script] that calls the iptaccount command to get usage info and display it in the browser. | ||
The EFF wireless firmware probably intermittently calls [https://github.com/EFForg/OpenWireless/blob/02841f7f4c22bd58e6712b98de05613011076ccf/routerapi/accumulate_bytes this script] which accumulates bytes used in a UCI config file. We could do something similar but with a lua script called by a cron job that simply takes down the tunnel when the quota is reached. | |||
There is also an iptables module called quota which can automatically enable/disable iptable rules when a quota is reached. It is not clear if it can be used to count both upstream and downstream bandwidth towards one total quota and it also has no built-in mechanism to persist the usage count between reboots. | |||
== tc − show / manipulate traffic control settings == | == tc − show / manipulate traffic control settings == |