NEW Package: freeRADIUS 2.x
-
Thanks, Im no coder either :0)
It could be my regex skills are also crap, but I thought I'd mention it as I noticed 1 or 2 posts on this thread pointing to this symptom, Ive since moved to an external radius server, just need to work out all the correct configs for it.
But without @ username, the pfsense package worked great, I had 2 pfsense fr2 syncing with eachother with no problems.
Cheers
-
hello,
first @ is not operator in php.
second, both functions You mentioned are bash scripts, so it doesn't matter.USERNAME=`echo -n "\$1" | sed 's/[^0-9a-zA-Z.:_-@]/X/g' ```this changes special characters to X. But finally it's just name of file so it doesn't matter if you save it with X as tomXmail.com or tom@mail.com. I don't use this function, but I'll try to help: 1\. Do You have only one backslash before $1 in USERNAME? 2\. Give me ouput (You can cut it, but I need sample name of username file (path /var/log/radacct/datacounter/\$TIMERANGE/max-octets-\$USERNAME"): You can do this command and paste somewhere.
ls -lar /var/log/radacct/datacounter/ > /root/datacounterlist
3\. As Nachtfalke wrote it could be problem in other function. We need to look into it: in function freeradius_modulesdatacounter_resync we need to change $conf variable a little. change only exec datacounterdaily
exec datacounterdaily {
wait = yes
program = "/bin/sh $varFREERADIUS_BASE/etc/raddb/scripts/datacounter_acct.sh %{request:User-Name} daily %{request:Acct-Input-Octets} %{request:Acct-Output-Octets} && /bin/sh echo %{request:User-Name} >> /root/usernames"
}
...maybe we would know something more with those files ;)
-
Thanks very much guys for offering to help and sorry I have not got back to this asap, been a bit busy as I have migrated my entire setup to pfsense 2.1 (radius accounting works great btw), I've setup an external radius server that sits on my dmz and its authenticating and accouting correctly with all my users, including "@" usernames.
I am a little free now to help fix this problem for the community because its ideal and more practical in some cases to give users the option to sign up with their email addresses with the pfSense FR2 package.
I have also worked out how to give users custom replies for my own setup if they fail authentication for what ever reason, I know a few people were looking for this as the default gave inconsistant replies for their setup .i.e "You have entered the wrong credentials" for a user who has used up their data allowance, instead of something liike this "You have used up your data allowance for this month".
Ill setup another vm with pfsense 2.0.3 soon (I cant find where FR2 pkg resides on 2.1) and post the result of the commands pszafer wrote.
TIA
-
Maybe better to test it on pfSense 2.1, so possible problem will no be reproduced in the newest version.
-
Good news for those that use this package with eap-tls. Current version now includes certificate revocation list(CRL) on eap Tab.
Once you revoke a client certificate, it will not be able to login anymore. :) -
Hey guys having a funny issue…with freeradius . It doesn't want to seem to start the freeradius daemon?
-
Hey guys having a funny issue…with freeradius . It doesn't want to seem to start the freeradius daemon?
What you got on log files?
-
Apr 19 06:33:17 check_reload_status: Reloading filter
Apr 19 07:42:06 check_reload_status: Syncing firewall
Apr 19 07:42:06 php: /pkg_edit.php: The command '/usr/local/etc/rc.d/radiusd.sh stop' returned exit code '1', the output was 'radiusd not running?'
Apr 19 07:42:06 php: /pkg_edit.php: The command '/usr/local/etc/rc.d/radiusd.sh stop' returned exit code '1', the output was 'radiusd not running?'
Apr 19 07:42:09 radiusd[15668]: rlm_sql (sql): Driver rlm_sql_mysql (module rlm_sql_mysql) loaded and linked
Apr 19 07:42:09 radiusd[15668]: rlm_sql (sql): Attempting to connect to radius@localhost:3306/radius
Apr 19 07:42:09 radiusd[15668]: rlm_sql (sql): Attempting to connect rlm_sql_mysql #0
Apr 19 07:42:09 radiusd[15668]: rlm_sql_mysql: Starting connect to MySQL server for #0
Apr 19 07:42:09 radiusd[15668]: rlm_sql_mysql: Couldn't connect socket to MySQL server radius@localhost:radius
Apr 19 07:42:09 radiusd[15668]: rlm_sql_mysql: Mysql error 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
Apr 19 07:42:09 radiusd[15668]: rlm_sql (sql): Failed to connect DB handle #0
Apr 19 07:42:09 radiusd[15668]: rlm_sql (sql): There are no DB handles to use! skipped 5, tried to connect 0
Apr 19 07:42:09 radiusd[15668]: Failed to load clients from SQL.
Apr 19 07:42:09 radiusd[15668]: rlm_sql (sql): Closing sqlsocket 4
Apr 19 07:42:09 radiusd[15668]: rlm_sql (sql): Closing sqlsocket 3
Apr 19 07:42:09 radiusd[15668]: rlm_sql (sql): Closing sqlsocket 2
Apr 19 07:42:09 radiusd[15668]: rlm_sql (sql): Closing sqlsocket 1
Apr 19 07:42:09 radiusd[15668]: rlm_sql (sql): Closing sqlsocket 0
Apr 19 07:42:09 radiusd[15668]: /usr/pbi/freeradius-i386/etc/raddb/sql.conf[2]: Instantiation failed for module "sql"
Apr 19 07:42:09 radiusd[15668]: /usr/pbi/freeradius-i386/etc/raddb/sites-enabled/default[185]: Failed to find "sql" in the "modules" section.
Apr 19 07:42:09 radiusd[15668]: /usr/pbi/freeradius-i386/etc/raddb/sites-enabled/default[185]: Failed to parse "sql" entry.
Apr 19 07:42:09 radiusd[15668]: /usr/pbi/freeradius-i386/etc/raddb/sites-enabled/default[69]: Errors parsing authorize section.
Apr 19 07:42:09 radiusd[15668]: Failed to load virtual server <default>Apr 19 07:42:23 check_reload_status: Syncing firewall
Apr 19 07:42:23 php: /pkg_edit.php: The command '/usr/local/etc/rc.d/radiusd.sh stop' returned exit code '1', the output was 'radiusd not running?'
Apr 19 07:42:23 php: /pkg_edit.php: The command '/usr/local/etc/rc.d/radiusd.sh stop' returned exit code '1', the output was 'radiusd not running?'
Apr 19 07:42:25 radiusd[23860]: rlm_sql (sql): Driver rlm_sql_mysql (module rlm_sql_mysql) loaded and linked
Apr 19 07:42:25 radiusd[23860]: rlm_sql (sql): Attempting to connect to radius@localhost:3306/radius
Apr 19 07:42:25 radiusd[23860]: rlm_sql (sql): Attempting to connect rlm_sql_mysql #0
Apr 19 07:42:25 radiusd[23860]: rlm_sql_mysql: Starting connect to MySQL server for #0
Apr 19 07:42:25 radiusd[23860]: rlm_sql_mysql: Couldn't connect socket to MySQL server radius@localhost:radius
Apr 19 07:42:25 radiusd[23860]: rlm_sql_mysql: Mysql error 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
Apr 19 07:42:25 radiusd[23860]: rlm_sql (sql): Failed to connect DB handle #0
Apr 19 07:42:25 radiusd[23860]: rlm_sql (sql): There are no DB handles to use! skipped 5, tried to connect 0
Apr 19 07:42:25 radiusd[23860]: Failed to load clients from SQL.
Apr 19 07:42:25 radiusd[23860]: rlm_sql (sql): Closing sqlsocket 4
Apr 19 07:42:25 radiusd[23860]: rlm_sql (sql): Closing sqlsocket 3
Apr 19 07:42:25 radiusd[23860]: rlm_sql (sql): Closing sqlsocket 2
Apr 19 07:42:25 radiusd[23860]: rlm_sql (sql): Closing sqlsocket 1
Apr 19 07:42:25 radiusd[23860]: rlm_sql (sql): Closing sqlsocket 0
Apr 19 07:42:25 radiusd[23860]: /usr/pbi/freeradius-i386/etc/raddb/sql.conf[2]: Instantiation failed for module "sql"
Apr 19 07:42:25 radiusd[23860]: /usr/pbi/freeradius-i386/etc/raddb/sites-enabled/default[185]: Failed to find "sql" in the "modules" section.
Apr 19 07:42:25 radiusd[23860]: /usr/pbi/freeradius-i386/etc/raddb/sites-enabled/default[185]: Failed to parse "sql" entry.
Apr 19 07:42:25 radiusd[23860]: /usr/pbi/freeradius-i386/etc/raddb/sites-enabled/default[69]: Errors parsing authorize section.
Apr 19 07:42:25 radiusd[23860]: Failed to load virtual server <default>Apr 19 13:16:40 php: /diag_logs.php: Session timed out for user 'admin' from: 172.22.2.170
Apr 20 03:24:36 dhclient: RENEW
Apr 20 03:24:36 dhclient: Creating resolv.confthats the log..im running version 2.1 of the pfsense but it doesnt start in the older version either. I dont have the captive portal active but im trying to activate sql.</default></default>
-
When using MySQL with freeradius then you need an SQL server somewhere. FR2 does not have any - it just connects to a SQL server.
Further there is a problem that the configuration is working fpr freeradius 2.1.12 which installs on pfsense 2.0.x.
On pfsense 2.1 the developers updated the package to version 2.2.0. But this version is not represented in the freeradius.inc file. I posted this twice on the mailing list but the did not update the "old" version to 2.2.0, too.But this could be probably easily fix. Modify:
/usr/local/pkg/freeradius.inc
On lines 83 and 217.
Replace
freeradius-2.1.12
with
freeradius-2.2.0
Then restarting freeradius could do the trick and if it does not then restarting pfsense will do it.
-
I've also pushed a fix to check installed freeradius lib version. This may reduce config errors.
-
Updates pkg v1.6.7:
-
Added: Possibility to use pfsense's Certificate Revocation List (CRL) with freeradius. Thank you to marcelloc for the code contribution. I really appreciate that and this was I feature I would like to add a long time ago but never was able to code it.
-
Added: Check if freeradius version 2.1.12 is used or 2.2.0. Thanks again to marcelloc.
-
Removed: Unneeded possibility to export Client.p12 file from FR2 - EAP GUI. This can be done much more comfortable from pfsense Cert Manager.
Known bugs:
-
When using "stop/start accounting on CP then "Amount of Time/Amount of Traffic" isn't working correctly.
http://redmine.pfsense.org/issues/2164 -
When using CP + RADIUS + Vouchers and "reauthenticate every minute" is enabled then CP sends the voucher as username to RADIUS. This causes RADIUS to disconnect the "user/voucher" because of an unknown/wrong "username".
http://redmine.pfsense.org/issues/2155 -
When stop/start accounting on CP is enabled than the syslog shows many "wrong order" or "Login found bot no logout detected". This seems to not affect the usage of RADIUS but it is not 100% correct.
http://redmine.pfsense.org/issues/2143
-
-
how fast will that update show in the snapshot???i see its in the github ??
-
how fast will that update show in the snapshot???i see its in the github ??
The code is already pushed, just reinstall the package to get these fixes.
-
eish dont know if im doing something wrong but it looks a bit better but still no sql…I do see its still trying to connect to localhost even that I set it to ip of sql server.
Apr 20 20:45:37 php: /pkg_edit.php: The command '/usr/local/etc/rc.d/radiusd.sh stop' returned exit code '1', the output was 'radiusd not running?'
Apr 20 20:45:37 php: /pkg_edit.php: The command '/usr/local/etc/rc.d/radiusd.sh stop' returned exit code '1', the output was 'radiusd not running?'
Apr 20 20:45:39 radiusd[21851]: rlm_sql (sql): Driver rlm_sql_mysql (module rlm_sql_mysql) loaded and linked
Apr 20 20:45:39 radiusd[21851]: rlm_sql (sql): Attempting to connect to radius@localhost:3306/radius
Apr 20 20:45:39 radiusd[21851]: rlm_sql (sql): Attempting to connect rlm_sql_mysql #0
Apr 20 20:45:39 radiusd[21851]: rlm_sql_mysql: Starting connect to MySQL server for #0
Apr 20 20:45:39 radiusd[21851]: rlm_sql_mysql: Couldn't connect socket to MySQL server radius@localhost:radius
Apr 20 20:45:39 radiusd[21851]: rlm_sql_mysql: Mysql error 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
Apr 20 20:45:39 radiusd[21851]: rlm_sql (sql): Failed to connect DB handle #0
Apr 20 20:45:39 radiusd[21851]: rlm_sql (sql): There are no DB handles to use! skipped 5, tried to connect 0
Apr 20 20:45:39 radiusd[21851]: Failed to load clients from SQL.
Apr 20 20:45:39 radiusd[21851]: rlm_sql (sql): Closing sqlsocket 4
Apr 20 20:45:39 radiusd[21851]: rlm_sql (sql): Closing sqlsocket 3
Apr 20 20:45:39 radiusd[21851]: rlm_sql (sql): Closing sqlsocket 2
Apr 20 20:45:39 radiusd[21851]: rlm_sql (sql): Closing sqlsocket 1
Apr 20 20:45:39 radiusd[21851]: rlm_sql (sql): Closing sqlsocket 0
Apr 20 20:45:39 radiusd[21851]: /usr/pbi/freeradius-i386/etc/raddb/sql.conf[2]: Instantiation failed for module "sql"
Apr 20 20:45:39 radiusd[21851]: /usr/pbi/freeradius-i386/etc/raddb/sites-enabled/default[185]: Failed to find "sql" in the "modules" section.
Apr 20 20:45:39 radiusd[21851]: /usr/pbi/freeradius-i386/etc/raddb/sites-enabled/default[185]: Failed to parse "sql" entry.
Apr 20 20:45:39 radiusd[21851]: /usr/pbi/freeradius-i386/etc/raddb/sites-enabled/default[69]: Errors parsing authorize section.
Apr 20 20:45:39 radiusd[21851]: Failed to load virtual server <default></default> -
@skoenman
there was a small typo in the freeradius.inc file. Try to reinstall the package and please try again. -
I have successfully setup WPA2 Enterprise with EAP-TLS. Is there a way to create a user, that is not allowed to login with a password? I just want to use certificates and I have noticed that I can login (via MSCHAPv2 I guess) without certificates by just providing the user/password combo I created. Leaving the password entry empty allows the user to login without any password, so that is not an option.
For a test, I removed "Cleartext-Password :=" leaving just the username in the file "users". That seems to prevent the user from logging in with an empty password while still allowing login using certificates.
Is there a more elegant way to do this? Don't know if it is a supported option to just put a user in "users" without any option afterwards. But if it was, could it be made an option in the in users sections of the freeradius2 package? -
http://doc.pfsense.org/index.php/FreeRADIUS_2.x_package#General_EAP_configuration
Try with the docs. Disable weak EAP types. enable check cert user.
-
http://doc.pfsense.org/index.php/FreeRADIUS_2.x_package#General_EAP_configuration
Try with the docs. Disable weak EAP types. enable check cert user.
Thanks for the quick answer, I used the wiki for my initial setup some time ago.
I'm sorry if I overlooked something, but I cannot find "check cert user", do you mean "Check Client Certificate CN"? That is already checked.
I found out that I can delete the user completely and still login via EAP-TLS when no user is defined. It seems any certificate issued by the pfSense internal CA is vaild for login now, even though I selected a specific cert in "CERTIFICATES FOR TLS" for "SSL Client Certificate". Cannot find any reference to that cert in eap.conf, though. Where would that client cert be found?
Here are my settings:
-
@athurdent
I just posted the docs to make sure you found the information there.In general EAP-TLS works without username and password. If the client has a valid client certificate which matches the CA on the freeradius server then the authentication will work.
If you enable "Check Client Certificate CN" then the common name of the client certificate must match the username (and password) in the users file. If you disable "Check Client Certificate CN" then the users file will not be checked.
On the GUI screenshots you posted there is something which shouldn't be there and confuses people in the past. I updated that yesterday and forget something which I removed right now. Reinstall the packages "GUI" and it will remove useless "SSL Client Certificate". (This was a kind of export feature which is useless and can be done from SYSTEM –> Cert Manager --> Certificate --> Download .p12)
The only certificates you need to enter on the freeradius GUI is the CA and the server certificate. Client certificate must be copied to your WLAN client. Perhaps try with a new client certificate and remove the old one from your machine or create a complete new CA and server certificate and client certificate.
If you like to read more about "Check Client Certificate CN" then google for "check_cert_cn" which is the configuration line on freeradius eap.conf file. I do not find to much on the web.
Hope this will help you!
-
Guys got the freeradius to run…now i added a user with password but it wasnt addded to the db what could be the problem???sql db???it doesnt give any errors in the logs and connects fine...does pfsense update the username and password into the db and if so how often???
edit i have whmcs creating the username and password but need to import it into pfsense???