radius

Installation:

sudo apt-get install freeradius

Configuring FreeRADIUS:

FreeRADIUS has a primary configuration file called radiusd.conf. Various other configuration files get sourced through the primary configuration file using the $INCLUDE keyword.

NAS devices:

An NAS device is a RADIUS client and shares a secret with the RADIUS server. NAS devices are defined in the clients.conf file. The localhost is by default defined as a client. This enables us to do various tests with RADIUS client programs like radclient and radtest.

Defining users: The users file is a quick and simple way to define users and is used by the files module. Users defined in the users file have check and reply AVPs. Some of these AVPs have special meaning to FreeRADIUS and influence the behavior
of the authentication and authorization outcomes.

A simple setup:

1. Ensure that you are root in order to be able to edit the configuration files.
2. FreeRADIUS includes a default client called localhost. This client can be used by RADIUS client programs on the localhost to help with troubleshooting and testing. Confirm that the following entry exists in the clients.conf file:

3. Define Alice as a FreeRADIUS test user. Add the following lines at the top of the users file. Make sure the second and third lines are indented by a single tab character:

4. Start the FreeRADIUS server in debug mode. Make sure that there is no other instance running by shutting it down through the startup script.

You can also use the more brutal method of kill -9 $(pidof freeradius) or killall freeradius.

5.  Ensure FreeRADIUS has started correctly by confirming that the last line on your screen says the following:

If this did not happen, read through the output of the FreeRADIUS server started in debug mode to see what problem was identified and a possible location thereof.
6.  Authenticate Alice using the following command:

7. The debug output of FreeRADIUS will show how the Access-Request packet arrives and how the FreeRADIUS server responds to this request.

8. Radtest will also show the response of the FreeRADIUS server:

To list all the installed FreeRADIUS packages: