Traffic Quota with IPFW or PF?
-
Hello!
Does anybody know how to use IPFW or PF to provide web traffic quota per host in a network?
For example, say I want to limit every host to a 1GB amount of web traffic per day.I heard IPFW is only used for the Captive Portal. I think the web GUI doesn't allow this to be configured, but I don't mind doing stuff on the terminal.
If it works, I may even start developing a package for web interfacing it. :)Thanks a lot.
-
Yes, Captive Portal uses ipfw and that is the only baked-in way to do traffic quotas, from what I understand of it.
-
@KOM:
Yes, Captive Portal uses ipfw and that is the only baked-in way to do traffic quotas, from what I understand of it.
Thanks a lot, KOM.
Could you, please, give me some examples on how to configure it?
I'm not really familiar with either IPFW or PF and the online tutorials I've found haven't been much helpful. =/Thank you.
-
I've never used it. To get the quotas, I think you also need to hook RADIUS accounting into the mix.
-
Just for the reference. Here is a snippet to get current traffic usage:
require_once("functions.inc"); require_once("captiveportal.inc"); $sent = (pfSense_ipfw_table_lookup("test_auth_up", $_SERVER['REMOTE_ADDR']))[bytes]; $received = (pfSense_ipfw_table_lookup("test_auth_down", $_SERVER['REMOTE_ADDR']))[bytes]; $used = $sent + $received;