Hands-on tutorial

Tutorials · Security

How to Set Up a RADIUS Server With FreeRADIUS for Wi-Fi and Switch Login

Install FreeRADIUS, add access points and switches as clients, authenticate users for WPA2/WPA3-Enterprise and 802.1X, and return VLANs, with secure secrets and logging.

Intermediate12 min7 steps

Before you start

  • A Linux server or container host on the management network
  • Switches and access points that support RADIUS
  • A user directory (local users to start, LDAP/AD later) and a server certificate for EAP

Step by step

  1. Install FreeRADIUS

    Install from your distribution's packages or run the official container. Keep it on a management VLAN that only network devices can reach.

    apt install freeradius freeradius-utils
    systemctl enable --now freeradius
    
  2. Add network devices as clients

    Each access point, controller or switch that sends requests is a client with its own long, random shared secret.

    # /etc/freeradius/3.0/clients.conf
    client core-sw1 {
      ipaddr = 10.0.99.2
      secret = <long-random-secret>
    }
    
  3. Install a proper certificate for EAP

    For PEAP or EAP-TLS, replace the test certificates with one from your internal CA. Clients must be configured to validate it, or they can be tricked by fake access points.

  4. Add users or connect the directory

    Start with a few test users, then connect LDAP or Active Directory so staff use their normal accounts.

  5. Return VLANs

    Send the VLAN in the reply attributes so each user group lands in the right network.

    Tunnel-Type = VLAN
    Tunnel-Medium-Type = IEEE-802
    Tunnel-Private-Group-Id = 20
    
  6. Test before enabling on devices

    Use radtest or eapol_test to check authentication, then enable it on one SSID or switch port.

    radtest alice 'Passw0rd!' 127.0.0.1 0 testing123
    
  7. Log and protect

    Send logs to your SIEM, enable Message-Authenticator on requests and replies, and run two RADIUS servers for redundancy.

Commands are generic, industry-standard examples. Exact syntax and menu names vary by model and firmware; check your device's manual on the Documentation page.

Pro tips

  • Never reuse the shared secret across devices.
  • Keep a local admin account on switches in case RADIUS is unreachable.
  • Patch FreeRADIUS promptly; see our BlastRADIUS guide.