Setting Up a RADIUS Server on Linux
A comprehensive guide to setting up a RADIUS server on Linux to connect to your router using a username and password using FreeRADIUS.
When logging into a router's setup page, you might notice the option for configuring a RADIUS server. If you’ve been curious about it but never tried, now’s the time!
Step 1: Update APT Cache
Open your terminal and run the following commands:
sudo bash
apt-get update
Then, install FreeRADIUS:
apt-get install freeradius -y
Step 2: Configure FreeRADIUS Clients
Edit the clients.conf file by executing:
sudo nano /etc/freeradius/clients.conf
Add a New Client
Insert the following configuration to accept clients from all IPs:
client 0.0.0.0/0 {
secret = {RADIUS shared key}
shortname = any
}
Info: This configuration allows clients from any IP.
Step 3: Configure Users
Edit the users file:
sudo nano /etc/freeradius/users
Add a New User to the File
Add the following line:
testuser Cleartext-password :="password"
Step 4: Restart the Service
Restart the FreeRADIUS service to apply the changes:
service freeradius restart
Additional Information
For more details, refer to FreeRADIUS Getting Started Guide.
That’s it! Now you'll need to configure the RADIUS server on your router. If you use it regularly, consider allocating a static IP to the device running the RADIUS server. Remember, the FreeRADIUS server runs on port 1812.
With these steps, you can now connect to your router using the username and password you've set.