From 9694747f7742b10aa929b7a3edad87493fcb7a21 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sat, 13 Aug 2005 23:07:57 +0000 Subject: Add per user bandwidth distribution package --- packages/per-user-bandwidth-distribution.xml | 55 ++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 packages/per-user-bandwidth-distribution.xml (limited to 'packages') diff --git a/packages/per-user-bandwidth-distribution.xml b/packages/per-user-bandwidth-distribution.xml new file mode 100644 index 00000000..c58c8b00 --- /dev/null +++ b/packages/per-user-bandwidth-distribution.xml @@ -0,0 +1,55 @@ + + per-user-bandwidth-distribution + 1.0.1 + Services: Per User Bandwidth + pkg_edit.php?xml=per-user-bandwidth-distribution.xml&id=0 + + Per User Bandwidth + Enforce a fair use bandwidth policy +
Services
+ per-user-bandwidth-distribution.xml +
+ + PerUserBandwidth + per_user_bandwidth_distribution.sh + + installedpackages->package->$packagename->configuration->settings + + + Bandwidth + bandwidth + Enter the bandwidth you would like to distribute: + input + + + Bandwidth Type + bandwidthtype + select + + + + + + + + + $fd = fopen("/usr/local/etc/rc.d/per_user_bandwidth_distribution.sh","w"); + fwrite($fd, "/sbin/kldload dummynet"); + fwrite($fd, "/sbin/ipfw add 10 pipe 1 ip from any to any out via {$wanif}"); + fwrite($fd, "/sbin/ipfw add 10 pipe 2 ip from any to any in via {$wanif}"); + fwrite($fd, "/sbin/ipfw add allow all from any to any"); + fwrite($fd, "/sbin/ipfw pipe 1 config mask src-ip 0x000000ff bw {$_POST['bandwidth']}{$_POST['bandwidthtype']}"); + fwrite($fd, "/sbin/ipfw pipe 2 config mask dst-ip 0x000000ff bw {$_POST['bandwidth']}{$_POST['bandwidthtype']}"); + fclose($fd); + mwexec("chmod a+rx /usr/local/etc/rc.d/per_user_bandwidth_distribution.sh"); + +
-- cgit v1.2.3