Sunday, August 7, 2011

How to Install, Configure and troubleshoot FreeRADIUS in simple steps

Posted on 4:13 AM by APC

FreeRadius is the word's most popular Radius server written by Alan Dekok. In this tut I would discuss how to installation, configuration and possible troubleshooting of  FreeRadius server on a Linux machine in few simple steps.
Installation: Open the terminal (Ctrl+Alt+T in Ubuntu) and enter the following commands one by one:
$ git clone git://git.freeradius.org/freeradius-server.git
$ cd freeradius-server
$ git fetch origin v2.1.x:v2.1.x
$ git checkout v2.1.x
Now from the same directory run these commands:

$ ./configure
$ sudo make
$ make install
 Now once you have installed FreeRadius server its time to configure it.
Configuration:After successfully installing the FreeRADIUS add the RADIUS client (switch) info in the clients.conf file. To add a client, go into the /usr/local/etc/raddb directory and open the file clients.conf and add the client with the appropriate shared secret something like this:
client ip_of_switch {
secret = radius123
shortname = Switch
}
Also, create a username and password, for 802.1X authentication, by adding a new user in “users” file which is located in /usr/local/etc/raddb. 
Troubleshooting: I have encountered following problems while trying to run the server. I hope the solution which worked for me will work for you as well.
1. While executing radiusd -X, it may throw the following error:
“radiusd: error while loading shared libraries:
libfreeradius-radius-2.1.10.so:
cannot open shared object file: No such file or directory”
The reason for this error is that the libraries have been installed in a place where dynamic linker cannot find it. To solve this problem use this command:
sudo /sbin/ldconfig -v
2. While running in debug mode the RADIUS server may give the following error:
“Ignoring EAP-Type/tls because we do not have OpenSSL support.
[eap] Request found, released from the list
[eap] EAP NAK
[eap] NAK asked for unsupported type PEAP
[eap] No common EAP types found.
[eap] Failed in EAP select
++[eap] returns invalid
Failed to authenticate the user.”
The reason for this error is that open ssl dev library “libssl-dev” is not installed. Install the library and re-configure (by running configure, make and make install) FreeRADIUS server.
3. Running the RADIUS server may also result in the following error:
“Error: Failed binding to authentication address * port 1812: Address already in use /usr/local/etc/raddb/radiusd.conf[240]: Error binding to port for 0.0.0.0 port 1812”
The reason for this error is that another instance of radius is running and has occupied the port. See which radius process is running: “ps aux | grep radius”
And then kill that process: “sudo kill -9 process_id”
Alternatively, use: sudo /etc/init.d/freeradius stop
Hope it helps you. Question, suggestions and a word of thanks is welcomed.

No Response to "How to Install, Configure and troubleshoot FreeRADIUS in simple steps"

Leave A Reply