From 961a79d219a5caae07a60ade7229adc378a9d5d9 Mon Sep 17 00:00:00 2001 From: Nachtfalke Date: Sun, 15 Jan 2012 22:50:35 +0100 Subject: Update config/freeradius2/freeradius.inc --- config/freeradius2/freeradius.inc | 149 ++++++++++++++++++++++++++++++++++---- 1 file changed, 136 insertions(+), 13 deletions(-) diff --git a/config/freeradius2/freeradius.inc b/config/freeradius2/freeradius.inc index 1d59ef37..37e544b5 100644 --- a/config/freeradius2/freeradius.inc +++ b/config/freeradius2/freeradius.inc @@ -341,7 +341,14 @@ instantiate { weekly monthly forever - + maxdailyupload + maxdailydownload + maxweeklyupload + maxweeklydownload + maxmonthlyupload + maxmonthlydownload + maxupload + maxdownload expiration logintime ### Dis-/Enable sql instatiate @@ -386,11 +393,17 @@ if (is_array($arrusers) && !empty($arrusers)) { $varusersframedipaddress = $users['varusersframedipaddress']; $varusersframedipnetmask = $users['varusersframedipnetmask']; $varusersframedroute = $users['varusersframedroute']; - $varusersexpiration=$users['varusersexpiration']; - $varuserssessiontimeout=$users['varuserssessiontimeout']; - $varuserslogintime=$users['varuserslogintime']; - $varusersvlanid=$users['varusersvlanid']; - + $varusersexpiration = $users['varusersexpiration']; + $varuserssessiontimeout = $users['varuserssessiontimeout']; + $varuserslogintime = $users['varuserslogintime']; + $varusersvlanid = $users['varusersvlanid']; + $varusersamountoftime = ($users['varusersamountoftime']?$users['varusersamountoftime']:''); + $varuserspointoftime = $users['varuserspointoftime']; + $varusersamountofbytesinput = ($users['varusersamountofbytesinput']?$users['varusersamountofbytesinput']:''); + $varuserspointoftimebytesinput = $users['varuserspointoftimebytesinput']; + $varusersamountofbytesoutput = ($users['varusersamountofbytesoutput']?$users['varusersamountofbytesoutput']:''); + $varuserspointoftimebytesoutput = $users['varuserspointoftimebytesoutput']; + // Clear variables for next user foreach additional options TOP $varuserstopadditionaloptions = ''; $varusersadditionaloptionstop = ''; @@ -442,12 +455,20 @@ if (is_array($arrusers) && !empty($arrusers)) { } if ($varuserslogintime != '') { $varuserscheckitem .= ", Login-Time := " . '"' . $varuserslogintime . '"'; + } + if ($varusersamountoftime != '') { + $varuserscheckitem .= ", Max-" . "$varuserspointoftime" . "-Session := " . "$varusersamountoftime"; } + if ($varusersamountofbytesinput != '') { + $varuserscheckitem .= ", Max-" . "$varuserspointoftimebytesinput" . "-Input := " . "$varusersamountofbytesinput"; + } + if ($varusersamountofbytesoutput != '') { + $varuserscheckitem .= ", Max-" . "$varuserspointoftimebytesoutput" . "-Output := " . "$varusersamountofbytesoutput"; + } if ($varusersadditionaloptionscheckitems != '') { $varuserscheckitem .= ", $varusersadditionaloptionscheckitems"; } - - + // Add additional REPLY-ITEMS here. Different formatting in "users" file needed. if ($varusersframedipaddress != '') { if ($varusersreplyitem != '') { $varusersreplyitem .=","; } @@ -640,6 +661,7 @@ function freeradius_eapconf_resync() { // The filenames of pfsense cert manager are different from freeradius cert manager so it is possible to store both in the same folder at any time. // This is for the pfsense cert manager // Depends on "freeradius_get_server_certs" and "freeradius_get_ca_certs" + if ($eapconf['vareapconfchoosecertmanager'] == 'on') { $ca_cert = lookup_ca($eapconf["ssl_ca_cert"]); @@ -1305,8 +1327,14 @@ authorize { weekly monthly forever - - + maxdailyupload + maxdailydownload + maxweeklyupload + maxweeklydownload + maxmonthlyupload + maxmonthlydownload + maxupload + maxdownload # # Use the checkval module checkval @@ -1500,8 +1528,15 @@ accounting { weekly monthly forever + maxdailyupload + maxdailydownload + maxweeklyupload + maxweeklydownload + maxmonthlyupload + maxmonthlydownload + maxupload + maxdownload - # Update the wtmp file # # If you don't use "radlast", you can delete this line. @@ -1675,12 +1710,12 @@ post-auth { # 'edir_account_policy_check = yes' in the ldap module configuration # Post-Auth-Type REJECT { + # log failed authentications in SQL, too. -# sql + # sql attr_filter.access_reject } } - # # When the server decides to proxy a request to a home server, # the proxied request is first passed through the pre-proxy @@ -2386,6 +2421,94 @@ counter forever { cache-size = 5000 } +counter maxdailyupload { + filename = \${raddbdir}/db.maxdailyupload + key = User-Name + count-attribute = Acct-Input-Octets + reset = daily + counter-name = Daily-Input-Octets + check-name = Max-Daily-Input + reply-name = ChilliSpot-Max-Input-Octets + cache-size = 5000 +} + +counter maxdailydownload { + filename = \${raddbdir}/db.maxdailydownload + key = User-Name + count-attribute = Acct-Output-Octets + reset = daily + counter-name = Daily-Output-Octets + check-name = Max-Daily-Output + reply-name = ChilliSpot-Max-Output-Octets + cache-size = 5000 +} + +counter maxweeklyupload { + filename = \${raddbdir}/db.maxweeklyupload + key = User-Name + count-attribute = Acct-Input-Octets + reset = weekly + counter-name = Weekly-Input-Octets + check-name = Max-Weekly-Input + reply-name = ChilliSpot-Max-Input-Octets + cache-size = 5000 +} + +counter maxweeklydownload { + filename = \${raddbdir}/db.maxweeklydownload + key = User-Name + count-attribute = Acct-Output-Octets + reset = weekly + counter-name = Weekly-Output-Octets + check-name = Max-Weekly-Output + reply-name = ChilliSpot-Max-Output-Octets + cache-size = 5000 +} + +counter maxmonthlyupload { + filename = \${raddbdir}/db.maxmonthlyupload + key = User-Name + count-attribute = Acct-Input-Octets + reset = monthly + counter-name = Monthly-Input-Octets + check-name = Max-Monthly-Input + reply-name = ChilliSpot-Max-Input-Octets + cache-size = 5000 +} + +counter maxmonthlydownload { + filename = \${raddbdir}/db.maxmonthlydownload + key = User-Name + count-attribute = Acct-Output-Octets + reset = monthly + counter-name = Monthly-Output-Octets + check-name = Max-Monthly-Output + reply-name = ChilliSpot-Max-Output-Octets + cache-size = 5000 +} + +counter maxupload { + filename = \${raddbdir}/db.maxforeverupload + key = User-Name + count-attribute = Acct-Input-Octets + reset = never + counter-name = Forever-Input-Octets + check-name = Max-Forever-Input + reply-name = ChilliSpot-Max-Input-Octets + cache-size = 5000 +} + +counter maxdownload { + filename = \${raddbdir}/db.maxforeverdownload + key = User-Name + count-attribute = Acct-Output-Octets + reset = never + counter-name = Forever-Output-Octets + check-name = Max-Forever-Output + reply-name = ChilliSpot-Max-Output-Octets + cache-size = 5000 +} + EOD; $filename = RADDB . '/modules/counter'; -- cgit v1.2.3 From 2595f2646e3b6e0e6dfceb624a7a1fd3b9db3626 Mon Sep 17 00:00:00 2001 From: Nachtfalke Date: Sun, 15 Jan 2012 22:51:11 +0100 Subject: Update config/freeradius2/freeradius.xml --- config/freeradius2/freeradius.xml | 61 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/config/freeradius2/freeradius.xml b/config/freeradius2/freeradius.xml index 2b31996a..97259310 100644 --- a/config/freeradius2/freeradius.xml +++ b/config/freeradius2/freeradius.xml @@ -286,6 +286,67 @@ This means weekdays after 8:55 AM and before 11:05 PM | any time on saturday | sunday after 10:30 PM and before 02:30 AM.]]> input + + AMOUNT OF TIME AND TRAFFIC + listtopic + + + Amount of Time + varusersamountoftime + + input + + + Time Period + varuserspointoftime + + select + daily + + + + + + + + + Amount of Upload Traffic + varusersamountofbytesinput + + input + + + Time Period + varuserspointoftimebytesinput + + select + daily + + + + + + + + + Amount of Download Traffic + varusersamountofbytesoutput + + input + + + Time Period + varuserspointoftimebytesoutput + + select + daily + + + + + + + MISCELLANEOUS CONFIGURATION listtopic -- cgit v1.2.3 From 7b9abfc31ec957e4d56c1d3947a9062beb9d4fb2 Mon Sep 17 00:00:00 2001 From: Nachtfalke Date: Sun, 15 Jan 2012 22:51:33 +0100 Subject: Update pkg_config.8.xml.amd64 --- pkg_config.8.xml.amd64 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64 index 79e252e2..91a6119c 100644 --- a/pkg_config.8.xml.amd64 +++ b/pkg_config.8.xml.amd64 @@ -853,7 +853,7 @@ On pfSense docs there is a how-to which could help you on porting users.]]> http://doc.pfsense.org/index.php/FreeRADIUS_2.x_package System - 2.1.12 pkg v1.5.1 + 2.1.12 pkg v1.5.2 BETA 2.0 nachtfalkeaw@web.de -- cgit v1.2.3 From 859827c1935a3e41a7f9df4efae2a6b10e03dcfc Mon Sep 17 00:00:00 2001 From: Nachtfalke Date: Sun, 15 Jan 2012 22:51:53 +0100 Subject: Update pkg_config.8.xml --- pkg_config.8.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg_config.8.xml b/pkg_config.8.xml index 68233511..84db2996 100644 --- a/pkg_config.8.xml +++ b/pkg_config.8.xml @@ -807,7 +807,7 @@ On pfSense docs there is a how-to which could help you on porting users.]]> http://doc.pfsense.org/index.php/FreeRADIUS_2.x_package System - 2.1.12 pkg v1.5.1 + 2.1.12 pkg v1.5.2 BETA 2.0 nachtfalkeaw@web.de -- cgit v1.2.3