authcha learn

Learn / Network engineer

802.1X with EAP-TTLS

Module 1 of 5 · 30 minutes

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 10

Then 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.

PathWhat it meansUse it
A. Do not validateThe tunnel still encrypts the password, but a rogue access point with a forged certificate could collect credentialsPilots and closed wired networks only
B. ValidateYou give every client the CA certificate (ca.pem) and set the expected server name. Supplicants then reject any other serverProduction

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 -dates

Push 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 anonymous as the anonymous identity.
  • Linux: use NetworkManager with 802-1x.eap ttls and 802-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.

  1. Open Devices on the demo and find a switch. Note whether MAB is on.
  2. Open Live Auth and look for 802.1X logins. Open one and read which method and which user it used.
  3. Open Users. Pick an 802.1X user and notice they have no mobile number requirement.
  4. On your install, export the CA with the commands above and read its subject and dates.
  5. Write the ttls.conf file for a real user and run eapol_test against Authcha. Confirm SUCCESS.
  6. Change the password in the config to a wrong one and run again. Find the failure in Live Auth and read the reason.
  7. Run it once more with ca_cert pointing to a different file. What happens, and why does that matter for Path B?

Check yourselfQuiz

1In EAP-TTLS with PAP, what does PAP do?
2Do 802.1X users need a mobile number?
3Which certificate path should production use?
4Who issues the RADIUS server certificate on a new install?
5What does authentication order dot1x mab on a switch port achieve?

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_certs volume.
  • Test: eapol_test -c ttls.conf -a <authcha> -p 1812 -s '<secret>', expect SUCCESS.
  • Read more: Network access.