802.1X with EAP-TTLS
By the end you can
- Explain what 802.1X, EAP-TTLS and PAP each do in one sign-in
- Configure a switch port for 802.1X and register the switch in Authcha
- Choose between trusting the server certificate or not, and distribute the CA to clients
- Test a full EAP-TTLS login from a Linux machine
What 802.1X is for
A cable or a Wi-Fi password lets anyone in. 802.1X makes a device prove who it is before the switch port or the Wi-Fi network opens. The device runs a small client called a supplicant. The switch or access point (the authenticator) passes the conversation to Authcha (the authentication server) and only opens the port when Authcha says yes.
Authcha supports two methods for endpoints:
- EAP-TTLS with PAP inside. The device sets up an encrypted tunnel to the server, then sends the username and password through it. The users are ordinary Authcha users, so you need no separate endpoint directory, and 802.1X users need no mobile number. This module covers this method.
- EAP-TLS, where the device proves itself with a certificate issued by Authcha. The Identity and security track covers it.
Configure a switch port
This is a Cisco IOS-XE example. Other vendors have the same pieces: a RADIUS server entry, an 802.1X authentication list, and per-port settings.
aaa new-model
radius server AUTHCHA
address ipv4 192.0.2.10 auth-port 1812 acct-port 1813
key <shared-secret>
aaa group server radius AUTHCHA-GRP
server name AUTHCHA
ip radius source-interface Vlan10
aaa authentication dot1x default group AUTHCHA-GRP
aaa authorization network default group AUTHCHA-GRP
aaa accounting dot1x default start-stop group AUTHCHA-GRP
dot1x system-auth-control
!
interface GigabitEthernet1/0/10
switchport mode access
authentication port-control auto
authentication order dot1x mab
authentication priority dot1x mab
mab
dot1x pae authenticator
dot1x timeout tx-period 10Then register the switch under Devices and add it as a RADIUS client, exactly as you did in the Foundations track. If you want disconnects (a later module), add the aaa server radius dynamic-author block too.
Notice the port allows dot1x first and then mab. A laptop with a supplicant signs in with 802.1X. A printer with none falls through to MAC bypass. One switch, both kinds.
The server certificate
On first start, each installation creates its own private certificate authority (CA) and uses it to issue the RADIUS server's certificate. Nothing is shared between installations and no key ships in the images. The server certificate is valid for two years and renews itself, with the same CA, when fewer than 30 days remain. Clients that trust the CA keep working across renewals.
You then choose how clients treat that certificate.
| Path | What it means | Use it |
|---|---|---|
| A. Do not validate | The tunnel still encrypts the password, but a rogue access point with a forged certificate could collect credentials | Pilots and closed wired networks only |
| B. Validate | You give every client the CA certificate (ca.pem) and set the expected server name. Supplicants then reject any other server | Production |
Export the CA for distribution:
cd /opt/authcha
docker compose cp freeradius:/etc/raddb/certs/authcha/ca.pem ./authcha-radius-ca.pem
openssl x509 -in authcha-radius-ca.pem -noout -subject -datesPush it to clients with Group Policy, a configuration profile or your MDM. Back up the raddb_certs volume with your database. If the CA is lost, a new one is created and every client needs the new ca.pem.
Client settings
Every platform needs the same four choices: EAP method TTLS, phase 2 (inner) PAP, the CA certificate for Path B, and anonymous as the anonymous (outer) identity.
- Windows 10 and 11: the basic Wi-Fi dialog does not offer TTLS. Deploy a Wi-Fi profile (an XML file) with
netsh wlan add profile, and import the CA into the machine's trusted roots. For wired, use Group Policy under Wired Network (IEEE 802.3) Policies. - macOS and iOS: install a configuration profile (
.mobileconfig) by MDM or by opening it on the device. - Android: Settings, Wi-Fi, Add network, security WPA2/WPA3-Enterprise, EAP method TTLS, phase 2 PAP, the CA certificate, the username as identity, and
anonymousas the anonymous identity. - Linux: use NetworkManager with
802-1x.eap ttlsand802-1x.phase2-auth pap.
Complete profile examples for each are in the Network access guide.
Test without a real client
On a Linux machine that is registered as a RADIUS client, eapol_test from the wpa_supplicant package runs a complete EAP-TTLS login.
cat > ttls.conf <<'EOF'
network={
key_mgmt=WPA-EAP
eap=TTLS
identity="USERNAME"
anonymous_identity="anonymous"
password="PASSWORD"
phase2="auth=PAP"
ca_cert="/path/to/authcha-radius.pem"
}
EOF
eapol_test -c ttls.conf -a 192.0.2.10 -p 1812 -s '<shared-secret>'The last line of the output should be SUCCESS.
LabHands-on
Steps 1 to 3 work on the demo (viewer login demo-viewer, password Authcha-View-2026). The rest need your own install and a Linux machine registered as a RADIUS client.
- Open Devices on the demo and find a switch. Note whether MAB is on.
- Open Live Auth and look for 802.1X logins. Open one and read which method and which user it used.
- Open Users. Pick an 802.1X user and notice they have no mobile number requirement.
- On your install, export the CA with the commands above and read its subject and dates.
- Write the
ttls.conffile for a real user and runeapol_testagainst Authcha. ConfirmSUCCESS. - Change the password in the config to a wrong one and run again. Find the failure in Live Auth and read the reason.
- Run it once more with
ca_certpointing to a different file. What happens, and why does that matter for Path B?
Check yourselfQuiz
Cheat sheetKeep this
- EAP-TTLS (tunnel) + PAP (credentials inside). Users are normal Authcha users.
- Client: method TTLS, phase 2 PAP, outer identity
anonymous, CA certificate for Path B. - Path B (validate) for production. Path A (do not validate) for pilots only.
- Export the CA:
docker compose cp freeradius:/etc/raddb/certs/authcha/ca.pem . - Back up the
raddb_certsvolume. - Test:
eapol_test -c ttls.conf -a <authcha> -p 1812 -s '<secret>', expectSUCCESS. - Read more: Network access.