When to use EAP vs certificates
| Certificate auth | EAP password auth | |
|---|---|---|
| Client setup complexity | Higher (requires cert distribution) | Lower (username + password only) |
| Revocation | Per-certificate CRL/OCSP | Remove secret from gateway config |
| OS client compatibility | Varies | Broad (EAP-MSCHAPv2 built into Windows/macOS/iOS/Android) |
| Credential exposure | Private key never leaves client | Password stored in gateway config |
The gateway still authenticates itself to clients using a certificate. Only the client-to-gateway direction uses EAP.
Network topology
Certificate files
The gateway requires its own certificate and private key. EAP clients only need the CA certificate — no personal certificate is required.- moon (gateway)
- carol (roadwarrior)
Configuration
Gateway (moon)
send_certreq = no suppresses the gateway’s certificate request to the client. Without this, clients that do not have a certificate would fail during the IKE handshake before EAP even begins.
The secrets section maps EAP identities to passwords. Each entry is matched by the id field against the identity the client presents during EAP.
Roadwarrior (carol)
EAP identity variant
In some deployments, the IKEv2 identity used during key exchange differs from the EAP identity used for password authentication. A common case is where the client’s IKEv2 identity is its IP address (the default when noid is set), while the EAP identity is a human-readable username.
Use eap_id to decouple the two identities:
Gateway with eap_id = %any
eap_id = %any tells the gateway to look up EAP credentials by the EAP identity exchanged during EAP, rather than the outer IKEv2 identity. Secrets are keyed by short usernames (carol, dave) rather than email addresses.
Roadwarrior with eap_id
eap_id = carol sets only the EAP identity. The IKEv2 identity defaults to the client’s source IP address, which the gateway accepts because eap_id = %any ignores it.
EAP-MSCHAPv2 variant
To use EAP-MSCHAPv2 instead of EAP-MD5, change theauth value on the gateway’s remote block:
secrets section format and the client configuration remain the same. EAP-MSCHAPv2 is widely supported by Windows, macOS, iOS, and Android native VPN clients.