TechBuzzPro

How to Configure a RADIUS Server for WiFi

· 6 min read · Wi-Fi & Networking

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To configure a RADIUS server for WiFi, you set up a server that authenticates users before they connect to your wireless network, then point your access points (APs) or wireless controller to it. This gives you centralized control over who can join, plus detailed logs. The steps below cover the core configuration using a Linux server with FreeRADIUS (the most common open-source option) and a typical enterprise access point. The exact menu names on your AP will vary by brand, but the concepts are universal.

What You'll Need

  • A server (physical or virtual) running Linux (Ubuntu/Debian recommended) with a static IP address.
  • Access to the server's command line (SSH or console).
  • WiFi access points or a wireless controller that supports WPA2-Enterprise or WPA3-Enterprise (most business-grade APs do).
  • A user database—either local users on the RADIUS server or an existing directory like LDAP/Active Directory (we'll cover local users for simplicity).
  • A shared secret (a long, random passphrase) that the APs and RADIUS server will use to talk to each other.

Step-by-Step

  1. Install FreeRADIUS on the server. On Ubuntu/Debian, run: sudo apt update && sudo apt install freeradius freeradius-utils. On CentOS/RHEL, use sudo yum install freeradius freeradius-utils. This installs the RADIUS daemon and command-line tools.
  2. Set a strong shared secret. Generate one with openssl rand -base64 32 and note it down. You'll need it on both the server and the APs.
  3. Configure the clients (your access points). Edit the file /etc/freeradius/3.0/clients.conf (the path may be /etc/freeradius/clients.conf on older versions). Add a block for each AP or for your entire subnet. For a single AP with IP 192.168.1.10, add:
    client ap1 {
        ipaddr = 192.168.1.10
        secret = your_shared_secret
        shortname = ap1
    }
    If all APs are on the same subnet, you can use ipaddr = 192.168.1.0/24 instead. Save the file.
  4. Add users to the RADIUS database. Edit /etc/freeradius/3.0/users (or /etc/freeradius/users). Add lines like:
    alice  Cleartext-Password := "password123"
    For better security, use an encrypted password hash. Generate one with sudo htpasswd -bnBC 10 "" yourpassword (install apache2-utils if needed) and paste the resulting hash as alice SSHA-Password := "{SSHA}hash". Save the file.
  5. Test the RADIUS server locally. Run sudo freeradius -X to start in debug mode. In another terminal, send a test authentication request:
    radtest alice password123 localhost 0 testing123
    If you see Access-Accept, the server is working. If you see Access-Reject, check the username/password and the debug output. Press Ctrl+C to stop debug mode and start the service normally with sudo systemctl start freeradius.
  6. Configure your access points to use the RADIUS server. Log into your AP's web interface (or controller). Look for a section called "RADIUS", "Authentication", or "Enterprise WiFi". You'll need to enter:
    • The RADIUS server's IP address (e.g., 192.168.1.5).
    • The shared secret (the same one you set in clients.conf).
    • The port: default is 1812 for authentication (and 1813 for accounting, if enabled).
    Save the settings on the AP.
  7. Create a WiFi network using WPA2-Enterprise or WPA3-Enterprise. On the AP, create a new SSID (network name). Under security, choose "WPA2-Enterprise" or "WPA3-Enterprise". Set the authentication method to "PEAP" or "EAP-TLS" (PEAP with passwords is simpler; EAP-TLS requires certificates). For PEAP, you usually don't need to configure anything else on the AP—just point it to the RADIUS server.
  8. Test with a real device. Connect a laptop or phone to the new SSID. It should prompt for a username and password. Enter the credentials you added in the users file (e.g., alice / password123). If it connects, you're done.

Common Mistakes

  • Using the wrong shared secret on the AP. The secret must match exactly between clients.conf and the AP. A single typo will cause silent failures.
  • Forgetting to open the firewall. If a firewall is active on the RADIUS server, UDP port 1812 (and 1813 for accounting) must be open. On Ubuntu, run sudo ufw allow 1812/udp and sudo ufw allow 1813/udp.
  • Using the wrong RADIUS port. Some APs default to 1812, but others might use 1645 (legacy). Stick with 1812 and make sure the AP is set to it.
  • Not enabling accounting. If you want logs of who connected and for how long, you need to enable accounting on the AP (port 1813). Without it, you only get authentication logs.
  • Putting the AP in the wrong subnet in clients.conf. If you use a subnet mask, make sure it covers all APs. A /32 for a single IP is fine, but if you have multiple APs, use a wider net.

Tips

  • Use a certificate for EAP-TLS if you can. It's more secure than passwords, but requires setting up a certificate authority (CA) and distributing client certificates. For small setups, PEAP with strong passwords is acceptable.
  • Back up your RADIUS config files. Copy clients.conf and users to a safe location. If you break something, you can restore quickly.
  • Set a long, random shared secret. Use at least 32 characters. This secret protects the RADIUS communication, so make it strong.
  • Monitor logs. FreeRADIUS logs to /var/log/freeradius/radius.log. Check it periodically to see failed attempts and spot issues.
  • Consider using a RADIUS management UI. Tools like daloRADIUS provide a web interface for managing users and clients, which is handy if you have many users.

Troubleshooting

If users can't connect, follow these steps in order:

  1. Check the RADIUS server is running. Run sudo systemctl status freeradius. If it's not active, start it with sudo systemctl start freeradius and check for errors in /var/log/freeradius/radius.log.
  2. Test locally. Use radtest again with a known user. If it fails, the problem is in the users file or the server configuration. Look at the debug output (sudo freeradius -X) for clues like "User not found" or "Password mismatch".
  3. Verify the AP can reach the server. From the AP's admin interface, ping the RADIUS server's IP. If it doesn't respond, check network routing and firewall rules on the server.
  4. Check the AP logs. Most APs have a log or status page that shows RADIUS authentication attempts. Look for "Access-Accept" or "Access-Reject" messages. A reject usually means bad credentials or a mismatch in the shared secret.
  5. Try a different EAP method. If the client says "authentication failed" but the server logs show an accept, the client might not support the EAP method. Switch to PEAP with MSCHAPv2 (the most compatible) on both the AP and client.
  6. Restart FreeRADIUS after config changes. Run sudo systemctl restart freeradius to apply changes. If you edited clients.conf or users, the service must be restarted.

Frequently Asked Questions

Can I use a RADIUS server with a home router?

Most home routers don't support WPA2-Enterprise or RADIUS. You'd need business-grade access points (like Ubiquiti, Ruckus, or Aruba) that explicitly list RADIUS support. Some open-source router firmware like OpenWrt can also act as a RADIUS client, but it's not trivial.

Do I need a certificate for RADIUS?

For PEAP, you need a server certificate on the RADIUS server to encrypt the authentication tunnel. FreeRADIUS includes a self-signed certificate by default, but clients will show a warning. For production, use a certificate from a trusted CA or your own internal CA. For EAP-TLS, you need certificates for both server and clients.

Can I use Active Directory with FreeRADIUS?

Yes. FreeRADIUS can authenticate against Active Directory via LDAP or using the ntlm_auth helper. You'll need to configure the LDAP module in FreeRADIUS and install the necessary packages. This is more complex than local users, but it allows you to use existing domain credentials.

How do I add or remove users?

Edit the users file and add a line per user, then restart FreeRADIUS. For a web interface, install daloRADIUS or a similar tool that manages users in a database backend.

What is the difference between authentication and accounting?

Authentication (port 1812) verifies who you are and allows or denies access. Accounting (port 1813) tracks session start/stop times and data usage. Accounting is optional but useful for auditing and billing.

Can I run RADIUS on Windows?

Yes, Windows Server has a built-in Network Policy Server (NPS) that acts as a RADIUS server. It's a viable option if you're already in a Microsoft environment. The configuration steps are different, but the concept is the same.