NEW Package: freeRADIUS 2.x
-
Try to install and….
$ pkg_add -r http://files.pfsense.org/packages/8/All/freeradius-2.1.12_1.tbz (...)
What do you want to do?
If you want to use freeradius2 package on pfsense then just go to
System –> Package Manager --> Available Packages
and install freeradius2No need to do that manual from the console and it will not work.
System –> Package Manager --> Available Packages
and install freeradius2
But dont RUN :(I tried all ways to install ... but this package does not want to start
$ radiusd -X FreeRADIUS Version 2.2.0, for host i386-portbld-freebsd8.3, built on Dec 20 2012 at 23:43:04 Copyright (C) 1999-2012 The FreeRADIUS server project and contributors. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. You may redistribute copies of FreeRADIUS under the terms of the GNU General Public License v2\. Starting - reading configuration files ... including configuration file /usr/pbi/freeradius-i386/etc/raddb/radiusd.conf including configuration file /usr/pbi/freeradius-i386/etc/raddb/clients.conf including files in directory /usr/pbi/freeradius-i386/etc/raddb/modules/ including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/wimax including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/always including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/attr_filter including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/attr_rewrite including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/cache including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/chap including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/checkval including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/counter including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/cui including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/detail including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/detail.example.com including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/detail.log including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/dhcp_sqlippool including configuration file /usr/pbi/freeradius-i386/etc/raddb/sql/mysql/ippool-dhcp.conf including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/digest including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/dynamic_clients including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/echo including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/etc_group including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/exec including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/expiration including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/expr including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/files including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/inner-eap including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/ippool including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/krb5 including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/ldap including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/linelog including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/otp including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/logintime including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/mac2ip including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/mac2vlan including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/mschap including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/ntlm_auth including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/opendirectory including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/pam including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/pap including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/passwd including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/perl including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/policy including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/preprocess including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/radrelay including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/radutmp including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/realm including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/redis including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/rediswho including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/replicate including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/smbpasswd including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/smsotp including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/soh including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/sql_log including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/sqlcounter_expire_on_login including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/sradutmp including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/unix including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/acct_unique including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/motp including configuration file /usr/pbi/freeradius-i386/etc/raddb/modules/datacounter_acct including configuration file /usr/pbi/freeradius-i386/etc/raddb/eap.conf including configuration file /usr/pbi/freeradius-i386/etc/raddb/policy.conf including files in directory /usr/pbi/freeradius-i386/etc/raddb/sites-enabled/ including configuration file /usr/pbi/freeradius-i386/etc/raddb/sites-enabled/default main { allow_core_dumps = no } including dictionary file /usr/pbi/freeradius-i386/etc/raddb/dictionary main { name = "radiusd" prefix = "/usr/pbi/freeradius-i386" localstatedir = "/var" sbindir = "/usr/pbi/freeradius-i386/sbin" logdir = "/var/log" run_dir = "/var/run" libdir = "/usr/pbi/freeradius-i386/lib/freeradius-2.1.12" radacctdir = "/var/log/radacct" hostname_lookups = yes max_request_time = 30 cleanup_delay = 5 max_requests = 1024 pidfile = "/var/run/radiusd.pid" checkrad = "/usr/pbi/freeradius-i386/sbin/checkrad" debug_level = 0 proxy_requests = yes log { stripped_names = yes auth = yes auth_badpass = yes auth_goodpass = yes msg_badpass = "" msg_goodpass = "" } security { max_attributes = 200 reject_delay = 1 status_server = no } } radiusd: #### Loading Realms and Home Servers #### radiusd: #### Loading Clients #### client system { ipaddr = 192.168.1.1 require_message_authenticator = no secret = "*******" shortname = "system" nastype = "other" } radiusd: #### Instantiating modules #### instantiate { Module: Linked to module rlm_exec Module: Instantiating module "exec" from file /usr/pbi/freeradius-i386/etc/raddb/modules/exec exec { wait = no input_pairs = "request" shell_escape = yes } Module: Linked to module rlm_expr Module: Instantiating module "expr" from file /usr/pbi/freeradius-i386/etc/raddb/modules/expr Module: Linked to module rlm_counter Module: Instantiating module "daily" from file /usr/pbi/freeradius-i386/etc/raddb/modules/counter counter daily { filename = "/var/log/radacct/timecounter/db.daily" key = "User-Name" reset = "daily" count-attribute = "Acct-Session-Time" counter-name = "Daily-Session-Time" check-name = "Max-Daily-Session" reply-name = "Session-Timeout" cache-size = 5000 } rlm_counter: Counter attribute Daily-Session-Time is number 11273 rlm_counter: Current Time: 1364223550 [2013-03-25 16:59:10], Next reset 1364248800 [2013-03-26 00:00:00] gdbm fatal: read error
-
gdbm fatal: read error
I saw this problem several times in other threads. In most cases it was a problem with the pfsense installation.
Can you try to do a fresh installation of pfsense and try the package again ?In general freeradius2 should start after you setup a listening interface.
-
Thanks for this great contribution.
I am currently testing pfsense 2.0.3 with freeradius2 in appliance only mode.
I think I've found a small bug, if a radius user is created with an email address .i.e "tom@example.com" and "Amount of traffic" is set, this user is unable to login.
I've added "@" to /usr/local/etc/raddb/scripts/datacounter_*.sh files on the line
USERNAME=`echo -n "$1" | sed 's/[^0-9a-zA-Z.:_-[color=red]@]/X/g'
I am able to log on with "tom@example.com", however traffic accounting completely stops, for all users not just ones with @ in their names, if I remove my changes from /usr/local/etc/raddb/scripts/datacounter_acct.sh, accounting works again but not for @ usernames.
Any help?
-
You probably need to modify that on both functions:
freeradius_datacounter_auth_resync() freeradius_datacounter_acct_resync()
Further you need to restart pfsense to recreate the .sh files.
Or you go to diagnostics –> command prompt:
require_once("/usr/local/pkg/freeradius.inc");
freeradius_datacounter_auth_resync();
freeradius_datacounter_acct_resync(); -
Thanks.
I had the same results, I even commented out the realms section where it denies @ logins, still nothing.
-
@Abdsalem:
Thanks.
I had the same results, I even commented out the realms section where it denies @ logins, still nothing.
Hmm, I am no coding expert so I am not sure why this is happening but I found the follwoing:
http://php.net/manual/de/language.operators.php
So it seems that @ is an operator in PHP.And in function:
function freeradius_modulesdatacounter_resync()
we need the username (%{request:User-Name}) from freeradius and this could perhaps cause problems.Is there a way to just get the value of %{request:User-Name} without doing any special with it ?
-
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>