per-user-bandwidth-distribution1.0.1Services: Per User Bandwidthpkg_edit.php?xml=per-user-bandwidth-distribution.xml&id=0PerUserBandwidthper_user_bandwidth_distribution.shinstalledpackages->package->$packagename->configuration->settingsBandwidthbandwidthEnter the bandwidth you would like to distribute:inputBandwidth Typebandwidthtypeselect
$fd = fopen("/usr/local/etc/rc.d/per_user_bandwidth_distribution.sh","w");
fwrite($fd, "/sbin/kldload dummynet");
fwrite($fd, "/sbin/ipfw delete 10");
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']}");
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 10 allow all from any to any");
fclose($fd);
mwexec("chmod a+rx /usr/local/etc/rc.d/per_user_bandwidth_distribution.sh");
mwexec_bg("/usr/local/etc/rc.d/per_user_bandwidth_distribution.sh");