WPA2-Enterprise on AX72 Pro with FreeRADIUS

The TP-Link Archer AX72 Pro has a neat little feature very few consumer routers have: WPA2-Enterprise allows each user to have their own password and other credentials, such as a TLS certificate.

To configure WPA2-Enterprise, you need a RADIUS server. For (Arch) Linux, there’s FreeRADIUS. To install it, run:

sudo pacman -S freeradius

Open port 1812 if you have a firewall. After that, open /etc/raddb/clients.conf. Edit:

client archer {
    ipaddr = 192.168.0.1
    secret = LongRandomSharedSecret
}

where LongRandomSharedSecret is your RADIUS password. You should make your own certificates and not use the test ones. To do so, cd /etc/raddb/certs and run make destroycerts. In ca.cnf and server.cnf, set input_password and output_password and fill in the [certificate_authority] and [server] fields. Give the server cert a CN like radius.example.com. In client.cnf, set the CN to the identity you want your TLS-enabled devices to have, e.g. laptop@example.com, and pick a password.

make            # builds CA, server cert, DH params
make client     # builds client.crt / client.p12
chown -R root:radiusd /etc/raddb/certs; chmod 640 /etc/raddb/certs/*.key

We need to set up EAP. vim /etc/raddb/mods-available/eap:

eap {
    default_eap_type = peap
    tls-config tls-common {
        private_key_password = <server.cnf output_password>
        private_key_file = ${certdir}/server.key
        certificate_file = ${certdir}/server.pem
        ca_file = ${cadir}/ca.pem
        check_cert_cn = %{User-Name}   # laptop identity must match its cert CN
    }
    tls { tls = tls-common }
    peap {
        tls = tls-common
        default_eap_type = mschapv2
        virtual_server = "inner-tunnel"
    }
}

Leave the default ttls and mschapv2 blocks as they are. Add the users: /etc/raddb/mods-config/files/authorize:

phone1  Cleartext-Password := "pass1"
phone2  Cleartext-Password := "pass2"
phone3  Cleartext-Password := "pass3"

To avoid storing passwords in plain text, use NT-Password := 0x<hash> instead:
printf '%s' 'pass1' | iconv -t utf16le | openssl dgst -md4 -provider legacy -provider default

Test, then run as a service:

radiusd -X                         # debug mode in the foreground
radtest -t mschap phone1 pass1 127.0.0.1 0 testing123
systemctl enable --now radiusd

testing123 is the default secret for localhost in clients.conf.

Set up the router. Go to Advanced → Wireless → Wireless Settings → Security and choose WPA/WPA2-Enterprise. Set Version to WPA2 and Encryption to AES. Enter your Linux box’s IP as the RADIUS server, port 1812, and the shared secret.

Set up the clients.

  • Android: EAP method PEAP, Phase 2 MSCHAPv2. Install ca.der as a Wi-Fi certificate (run make ca.der to create it). Set the domain to the server CN.
  • iOS: enter the username and password, then trust the server certificate when asked.
  • Laptop (NetworkManager): choose TLS. Set Identity to laptop@example.com, CA cert to ca.pem, and the user certificate/key to client.p12 with its password.

Discover more from nepetan's website!

Subscribe to get the latest posts sent to your email.

Leave a Reply