Network Access Control: 802.1X, EAP and MACsec
Where security protocols sit in the TCP/IP stack, and how enterprise networks decide who may plug in: 802.1X port-based access control, the EAP framework and its methods, RADIUS, key derivation, re-authentication, PANA and MACsec link encryption, with a real EAP-TLS and PEAP exchange.
kvi5hnuCode Sprout team member19 min readOn this page
The next articles work up the protocol stack: link-layer access control here, then IPsec at the network layer, TLS above the transport, and DNSSEC and email authentication in applications. Before starting, it's worth seeing where each protocol sits, because the layer decides what a protocol can protect.
Security at every layer
| Layer | Protects | Examples |
|---|---|---|
| Link | one hop, between neighbors on a LAN or radio link | 802.1X, EAP, MACsec, WPA2/WPA3 (Wi-Fi Protected Access, article 18) |
| Network | host to host, or site to site, for all traffic | IPsec, WireGuard |
| Transport and above | process to process | TLS, DTLS (TLS for datagrams), QUIC, SSH |
| Application | the application's own data, end to end | DNSSEC, DKIM, S/MIME (signed and encrypted email), OpenPGP |
Link-layer protection ends at the next switch or access point: data is in the clear inside every device it passes. Network-layer protection covers every application at once but authenticates machines, not users or names. Transport-layer protection authenticates the server's name and is what web browsers use. Application-layer protection, such as a signed DNS record or email, survives storage and relaying, because it travels with the data rather than the connection. Real networks use several layers at once. Two widely used protocols that this part doesn't cover in depth are Kerberos (RFC 4120), the trusted-third-party authentication system at the heart of Windows domains, and SSH (RFC 4251), the secure remote login and tunneling protocol.
802.1X: port-based network access control
Network access control (NAC) decides whether a device may use a network at all. In an office, anyone can plug a laptop into a wall socket. On Wi-Fi, anyone in range can try to join. The IEEE 802.1X standard (Port-Based Network Access Control, last revised in 2020) puts a gate on each switch port or wireless association, and opens it only after the device authenticates.
It has three roles:
- The supplicant is the device that wants access, running software such as
wpa_supplicanton Linux or the built-in client on Windows and macOS. - The authenticator is the switch or wireless access point. It controls the port but doesn't usually judge credentials itself.
- The authentication server decides. It's almost always a RADIUS server (RFC 2865), such as FreeRADIUS or Microsoft NPS (Network Policy Server). Diameter (RFC 6733) fills the same role in mobile networks. Servers that perform authentication, authorization and accounting are called AAA servers.

Each port has two logical sides. The uncontrolled port passes only authentication frames, called EAPOL (EAP over LAN, Ethertype 0x888E). The controlled port carries everything else, and stays blocked until the server says yes. After success, the server can also tell the switch which VLAN (virtual LAN, article 15) to put the device on, so employees, contractors and printers end up on different networks with different firewall rules, and devices that fail end up on a guest or remediation VLAN, or nowhere. Devices that can't run a supplicant, such as old printers, are often let in by MAC authentication bypass, which checks only the MAC address and is easy to spoof.
The switch acts in pass-through mode: it unwraps EAP from EAPOL frames and rewraps it in RADIUS messages, without understanding the authentication method inside. That's what lets one switch support any method the server supports.
EAP: a framework, not a protocol
The Extensible Authentication Protocol (EAP, RFC 3748) defines a small message format and leaves the actual authentication to methods. EAP terminology differs slightly from 802.1X: the supplicant is the peer, and the server that runs the method is the EAP server, usually the AAA server.

- Code distinguishes Request, Response, Success and Failure (plus Initiate and Finish, used by re-authentication).
- Identifier matches each response to its request. EAP is a lock-step protocol: the authenticator sends one request and waits for the response, retransmitting if needed. The lower layer must deliver in order but needn't be reliable.
- Type, in requests and responses, names the method. Types 1 to 3 are special: Identity asks who the peer is, Notification displays a message to the user, and Nak says "I don't support that method" (an Expanded Nak lists the ones it does support).
The "lower layer" that carries EAP varies: EAPOL on Ethernet and Wi-Fi, PPP on dial-up and some DSL links (article 19), IKEv2 inside IPsec, PANA over UDP (covered below), and, between authenticator and server, RADIUS. EAP has no fragmentation of its own, so methods that send large messages, such as certificate chains, fragment them.
A real 802.1X exchange
The course lab can't plug into a real switch, but it can build one. The setup is three network namespaces: a laptop running wpa_supplicant with its wired driver, a "switch" running hostapd as an 802.1X authenticator on port 1, and a RADIUS server (also hostapd, in server mode) at 192.0.2.10. A small lab CA issued a server certificate for radius.example.com and a client certificate for laptop-17.example.com.
EAP-TLS: certificates on both sides
EAP-TLS (RFC 5216, with TLS 1.3 in RFC 9190) runs a full TLS handshake inside EAP. The server proves its identity with its certificate, the client with its own certificate. There's no password to steal or guess. It's the strongest common method, but every device needs a certificate, which means running a PKI. What the laptop reported:
CTRL-EVENT-EAP-STARTED EAP authentication started
CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=13
CTRL-EVENT-EAP-METHOD EAP vendor 0 method 13 (TLS) selected
CTRL-EVENT-EAP-PEER-CERT depth=0 subject='/CN=radius.example.com'
CTRL-EVENT-EAP-SUCCESS EAP authentication completed successfully
CTRL-EVENT-CONNECTED - Connection to 01:80:c2:00:00:03 completed [id=0 id_str=]
method=13 is EAP type 13, EAP-TLS. The PEER-CERT depth=0 line is the server's own certificate (depth 0 is the leaf, as in article 80), and EAP-SUCCESS means the server accepted the laptop.
The laptop checked that the server's certificate came from the expected CA and named radius.example.com (the domain_match setting). Skipping that check is the classic enterprise Wi-Fi mistake: without it, anyone can set up a rogue access point with its own RADIUS server and certificate. The switch's view:
RADIUS Authentication server 192.0.2.10:1812
CTRL-EVENT-EAP-STARTED 02:00:00:00:01:01
CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=1
CTRL-EVENT-EAP-SUCCESS2 02:00:00:00:01:01
STA 02:00:00:00:01:01 RADIUS: starting accounting session DDCA550AFFC256A2
STA 02:00:00:00:01:01 IEEE 802.1X: authenticated - EAP type: 13 (TLS)
The switch started by asking for an identity (method 1) and then just relayed. It learned the outcome, EAP-TLS (type 13), from the server's answer. Here are the EAPOL frames on the laptop's link. They're sent to the group address 01:80:c2:00:00:03, which switches never forward:
0.498 laptop -> 01:80:c2:00:00:03 EAPOL-Start
0.499 switch -> 01:80:c2:00:00:03 EAP Request id=105 Identity len=5
0.500 laptop -> 01:80:c2:00:00:03 EAP Response id=105 Identity len=26
0.503 switch -> 01:80:c2:00:00:03 EAP Request id=106 TLS len=6
0.506 laptop -> 01:80:c2:00:00:03 EAP Response id=106 TLS len=205
0.507 switch -> 01:80:c2:00:00:03 EAP Request id=107 TLS len=1165
0.508 laptop -> 01:80:c2:00:00:03 EAP Response id=107 TLS len=1061
0.508 switch -> 01:80:c2:00:00:03 EAP Request id=108 TLS len=57
0.508 laptop -> 01:80:c2:00:00:03 EAP Response id=108 TLS len=6
0.509 switch -> 01:80:c2:00:00:03 EAP Success id=108 len=4
The laptop started with EAPOL-Start. The switch asked for an identity and the laptop gave its name. Then the server proposed EAP-TLS with a 6-byte "TLS start" request, and the handshake took three more round trips: the laptop's ClientHello (205 bytes) answered by the server's certificate and handshake messages (1,165 bytes); the laptop's certificate and Finished (about 1,060 bytes) answered by the server's Finished (57 bytes); and an empty acknowledgement, answered by EAP Success, which opened the port. That pattern, with the server's Finished in a separate last flight, is TLS 1.2, which wpa_supplicant uses for EAP unless TLS 1.3 is explicitly enabled (tls_disable_tlsv1_3=0); with TLS 1.3 (RFC 9190) the server's Finished travels in its first flight, and the server instead ends with a one-byte "commitment" message. The whole exchange took about 10 ms on a lab link. Across a campus to a busy RADIUS server, it typically takes tens to hundreds of milliseconds.
Between the switch and the server, the same exchange was RADIUS. Each EAP message rode in an EAP-Message attribute of an Access-Request, and the server's replies came back as Access-Challenge until the final Access-Accept:
0.000 Access-Request id=0 252 bytes laptop-17.example.com 02-00-00-00-01-01 sw1.example.com
0.001 Access-Challenge id=0 94 bytes
0.003 Access-Request id=1 437 bytes laptop-17.example.com 02-00-00-00-01-01 sw1.example.com
0.004 Access-Challenge id=1 1261 bytes
0.005 Access-Request id=2 1301 bytes laptop-17.example.com 02-00-00-00-01-01 sw1.example.com
0.006 Access-Challenge id=2 145 bytes
0.006 Access-Request id=3 238 bytes laptop-17.example.com 02-00-00-00-01-01 sw1.example.com
0.006 Access-Accept id=3 269 bytes
The columns are time, RADIUS message type, RADIUS packet ID, size, and for requests the user name, the laptop's MAC address and the switch's name. Each Access-Request is answered by a reply with the same ID.
The switch added its own identity (NAS-Identifier) and the laptop's MAC address (Calling-Station-Id), which the server can use in its policy. The Access-Accept carried the keys:
EAP-Message (6 bytes) Last Segment[1]
Vendor-Specific (58 bytes) vnd=Microsoft
MS-MPPE-Send-Key (52 bytes) val=Encrypted
Vendor-Specific (58 bytes) vnd=Microsoft
MS-MPPE-Recv-Key (52 bytes) val=Encrypted
EAP-Key-Name (67 bytes) val=0ddc15980985…
Message-Authenticator (18 bytes) val=9ce14b88c2467de67e87aca0bb291a50
The MS-MPPE-Send-Key and Recv-Key attributes (named after Microsoft Point-to-Point Encryption, where they started) carry key material derived by the method, encrypted with the RADIUS shared secret. On Wi-Fi, the access point uses them as the pairwise master key for WPA2 or WPA3; on wired links, they can feed MACsec. Message-Authenticator is an HMAC-MD5 (article 79) over the whole packet, keyed with the shared secret. The 2024 BlastRADIUS attack (CVE-2024-3596, its entry in the public Common Vulnerabilities and Exposures list) forged responses when it was missing, so current servers and clients send and require it in every authentication request and response. RADIUS's MD5-based protection is weak in any case, so traffic between authenticators and servers should cross only a trusted network or be carried over TLS (RadSec, RFC 6614). RFC 6614 is Experimental; its Standards Track replacement covering both TLS and DTLS (draft-ietf-radext-radiusdtls-bis) has been approved and is waiting in the RFC Editor queue as of November 2026.
PEAP: a password inside a TLS tunnel
Many organizations don't want to issue client certificates. PEAP (Protected EAP, a Microsoft and Cisco design) and EAP-TTLS (Tunneled TLS, RFC 5281) use TLS only to authenticate the server and build an encrypted tunnel, then run a password method inside it, typically MSCHAPv2 (Microsoft's challenge-response password protocol, version 2). The outer identity can be anonymous (anonymous@example.com in the lab), so the real username travels only inside the tunnel. With a wrong password:
CTRL-EVENT-EAP-STARTED EAP authentication started
CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=25
CTRL-EVENT-EAP-METHOD EAP vendor 0 method 25 (PEAP) selected
EAP-MSCHAPV2: failure message: 'FAILED' (retry not allowed, error 691)
CTRL-EVENT-EAP-FAILURE EAP authentication failed
Error 691 is MSCHAPv2's "authentication failed." With the right one:
CTRL-EVENT-EAP-STARTED EAP authentication started
CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=25
CTRL-EVENT-EAP-METHOD EAP vendor 0 method 25 (PEAP) selected
CTRL-EVENT-EAP-SUCCESS EAP authentication completed successfully
CTRL-EVENT-CONNECTED - Connection to 01:80:c2:00:00:03 completed [id=0 id_str=]
PEAP is only as safe as the client's server-certificate check. If the client accepts any certificate, a rogue access point can collect MSCHAPv2 exchanges, which can be cracked (MSCHAPv2's security reduces to a single 56-bit DES key, article 79). Credential Guard, on by default on eligible Windows 11 (22H2 and later) devices, blocks single sign-on and saved credentials for MSCHAPv2, so users must type their password for each session, which pushes organizations toward EAP-TLS. TEAP (Tunnel EAP, RFC 9930 from February 2026, which replaced RFC 7170) is the standard tunnel method that can combine machine and user authentication.
EAP methods and keys
More than 50 EAP methods exist. Besides EAP-TLS, PEAP, EAP-TTLS and TEAP, common ones include EAP-AKA and EAP-AKA' (Authentication and Key Agreement, RFC 9048), which authenticate with a mobile SIM card and are used for Wi-Fi calling and carrier Wi-Fi, and EAP-PWD (RFC 5931) for passwords without certificates. Old ones to avoid: EAP-MD5, which only authenticates the client, offers no keys and is open to offline dictionary attacks, and Cisco's LEAP, which is broken. Methods also differ in whether they authenticate both sides (mutual authentication) and whether they derive keys. Only methods that do both are suitable for wireless networks.
Key-deriving methods follow the EAP key management framework (RFC 5247):
- The master session key (MSK), at least 64 bytes, is exported to the authenticator (via those MS-MPPE attributes) and used to derive transient session keys that protect the link.
- The extended MSK (EMSK), also at least 64 bytes, never leaves the peer and server. It's used to derive further root keys for particular purposes (usage-specific, USRK) or domains (domain-specific, DSRK), per RFC 5295.
- Keys have lifetimes (8 hours is a common default for re-authentication), after which the peer must authenticate again. The lab switch was set to re-authenticate every hour.
Faster re-authentication
A phone walking between access points can't afford a full EAP-TLS exchange at each one. The EAP Re-authentication Protocol (ERP, RFC 6696, which replaced RFC 5296) derives a re-authentication root key from the EMSK during the first full authentication, and then proves knowledge of it in a single round trip (the Initiate and Finish codes) when the device moves, even to a different domain. Wi-Fi networks more often use their own fast-roaming schemes, such as 802.11r fast BSS transition (moving between access points of one network; a BSS, basic service set, is one access point's cell) and cached keys.
PANA: EAP over IP
802.1X works only on IEEE 802 networks, and PPP only on point-to-point links. The Protocol for Carrying Authentication for Network Access (PANA, RFC 5191) carries EAP over UDP (port 716), so it can authenticate devices on any link that carries IP. A PANA client (PaC) talks to a PANA authentication agent (PAA), which consults the authentication server and then configures an enforcement point to let the client's traffic through. A PANA relay element can forward messages when the client can't reach the PAA directly.
A PANA session goes through authentication, access, re-authentication (which extends the session's lifetime) and termination. Each message has a 32-bit session identifier and a 32-bit sequence number, with randomly chosen initial values. PANA provides its own simple reliability: stop-and-wait, a fixed retransmission timer with exponential backoff, and answers that echo the request's sequence number. It found use mainly in some smart-meter (Wi-SUN, ZigBee IP) networks; most networks rely on 802.1X.
MACsec: encrypting the wire
802.1X decides who may connect, but on a wired port it doesn't protect the frames afterwards. An attacker with physical access could put a small device between an authenticated laptop and the wall socket, and inject or read traffic. MACsec (IEEE 802.1AE) closes that gap by encrypting and authenticating every Ethernet frame between neighbors:

- Frames are protected with GCM-AES-128 or GCM-AES-256 (AEAD, as in article 79). The integrity check value (ICV) is the 16-byte GCM tag.
- The packet number in the SecTAG is part of the GCM nonce and lets the receiver reject replayed frames. The extended packet number (XPN) option uses 64-bit numbers, so a 100 Gbit/s link doesn't exhaust them within minutes.
- MACsec Key Agreement (MKA), defined in 802.1X-2010 and later, exchanges keys over EAPOL. It starts from a connectivity association key (CAK), which is either pre-shared or derived from an EAP exchange's MSK, and distributes the secure association keys (SAKs) that actually encrypt the traffic, changing them periodically.
- The secure channel identifier (SCI) names the sender's channel (its MAC address and a port number). It's needed when several stations share a medium, and optional on point-to-point links.
MACsec protects one hop at a time: every switch decrypts, forwards and re-encrypts. It's used on campus links, between data centers over leased Ethernet, and in mobile networks' backhaul. Linux supports it (ip link add … type macsec), and wpa_supplicant can run MKA, but the lab container's kernel doesn't include MACsec, so it isn't measured here.
802.1AR defines secure device identity: an initial device identifier (IDevID), a certificate and key installed by the manufacturer, often in a TPM (Trusted Platform Module, a tamper-resistant key chip), that a device can use for EAP-TLS straight out of the box, before any local certificate is issued.
Common questions
Is 802.1X worth it on a wired network?
It stops casual access from any wall socket and assigns VLANs automatically, which is why enterprises use it. Without MACsec, though, it authenticates only the start of a session, and a device inserted between an authenticated laptop and the port can piggyback on it.
Why does the server need a certificate even in PEAP?
The client has to know it's talking to the real authentication server before it sends anything derived from its password. Without that, a rogue access point can collect the MSCHAPv2 exchange and crack it offline.
What does WPA2-Enterprise or WPA3-Enterprise mean?
Wi-Fi security using 802.1X and EAP to authenticate each user, instead of one shared passphrase (Personal mode). The MSK from EAP becomes the pairwise master key that keys the Wi-Fi encryption. WPA3-Enterprise also has a 192-bit mode with stronger algorithms.
Why is RADIUS still used, given its weak MD5 protection?
It's universal, simple and supported by every switch and access point. The weak parts are being fixed: Message-Authenticator is now required, and RADIUS over TLS (RadSec) or DTLS protects the transport, especially when RADIUS crosses untrusted networks, as in the eduroam roaming federation.
Can the authenticator see my password?
Not with tunneled or certificate methods: the switch relays TLS records it can't decrypt. With EAP-MD5 or an inner method run without a tunnel, the exchange is visible to anyone on the path, which is why those are avoided.
What happens when a device fails 802.1X?
It depends on the switch's configuration: the port can stay closed, or the device can be put on a guest or remediation VLAN with internet access only, or with access only to the servers needed to fix it (updates, certificate enrollment).
Summary
- Security protocols exist at every layer: link (802.1X, MACsec, WPA), network (IPsec, WireGuard), transport (TLS, QUIC, SSH) and application (DNSSEC, DKIM). The layer determines what's protected and against whom.
- 802.1X has a supplicant, an authenticator (switch or access point) and an authentication server (RADIUS). Ports pass only EAPOL (Ethertype 0x888E) until the server sends Access-Accept, which can also assign a VLAN.
- EAP is a framework: a Code, Identifier, Length and Type header, with methods doing the work. The authenticator usually just relays.
- In the lab, EAP-TLS took a start message and three TLS round trips over EAPOL and RADIUS; PEAP-MSCHAPv2 failed with error 691 for a wrong password and succeeded with the right one. Clients must check the server's certificate and name.
- Key-deriving methods export an MSK to the authenticator and keep an EMSK. ERP re-authenticates in one round trip; PANA carries EAP over UDP for any link.
- MACsec encrypts each Ethernet hop with AES-GCM, with replay protection from packet numbers and keys from MKA.
Practice questions
1. In the lab's EAP-TLS exchange, how many EAP Request/Response pairs were there, and what did each carry?
Answer
Four. The first asked for and returned the identity. The second was the server's TLS start and the laptop's ClientHello. The third carried the server's certificate flight and the laptop's certificate and Finished. The fourth carried the server's Finished and the laptop's empty acknowledgement, after which the switch sent EAP Success. That's one identity pair plus three TLS-carrying pairs (counting the start), each matched by its Identifier.
2. Why are EAPOL frames sent to 01:80:c2:00:00:03 rather than to the switch's own MAC address?
Answer
The supplicant may not know the switch's address, and the group address is in the range that IEEE 802.1D bridges never forward. So the frame reaches exactly the device at the other end of the cable, the port's authenticator, and doesn't leak onto the rest of the LAN.
3. A company configures PEAP on its laptops but leaves "validate server certificate" off. What attack does that enable?
Answer
An evil-twin access point with the same network name, backed by an attacker's RADIUS server and any certificate. Laptops connect and run MSCHAPv2 inside a tunnel to the attacker, who captures the exchange and cracks the password offline (MSCHAPv2 reduces to cracking one DES key).
4. A RADIUS Access-Accept arrives at a switch without a Message-Authenticator attribute. What should a current switch do, and why?
Answer
Reject it. Since the BlastRADIUS attack (2024), an on-path attacker can forge an Access-Accept from an Access-Reject using an MD5 collision when the packet isn't covered by Message-Authenticator. Current implementations require the attribute in every authentication request and response, and expect it first in an Access-Accept or Access-Reject.
5. A 100 Gbit/s MACsec link sends minimum-size frames (about 148.8 million per second at line rate). How long before a 32-bit packet number runs out, and what fixes it?
Answer
2³² ÷ 148.8 million ≈ 29 seconds. The SAK would have to change twice a minute. The extended packet number (XPN) cipher suites use 64-bit packet numbers, which last thousands of years.
6. Which layer of protection does each of these give: WPA3 on your home Wi-Fi, a VPN to the office, HTTPS to a bank, and a DKIM signature on an email?
Answer
WPA3 is link-layer: it protects only between your device and the access point. The VPN (IPsec or WireGuard) is network-layer: all traffic between you and the office network. HTTPS is TLS, between your browser process and the bank's server. DKIM is application-layer: a signature on the message itself, checked by the recipient's mail system even after relaying.
Previous: Certificates and PKI: X.509, Certificate Authorities, Validation, Revocation and Transparency
Next: IPsec and IKEv2: AH, ESP, NAT Traversal, and WireGuard

More in TCP/IP Course
Quiz: TCP/IP Delicate Details
Twenty-five questions on the details that catch out experienced engineers: sequence numbers for SYN and FIN, TIME_WAIT versus tcp_fin_timeout, Karn's algorithm, socket buffer doubling, even and odd ephemeral ports, IPv6 checksums and fragmentation, negative DNS caching, and capture filter traps.
Quiz: TCP/IP Interview Questions
Thirty-three networking questions of the kind asked in developer, SRE and network engineering interviews: what happens when you load a URL, TCP versus UDP, handshakes, closing and TIME_WAIT, subnetting, NAT, DNS, MTU problems, congestion, TLS and QUIC, and debugging slow or failing connections.
Quiz: TCP/IP Course Final Exam (All Parts)
The final exam for the TCP/IP course: thirty questions across all fourteen parts, from packets and addressing through Ethernet, ARP, IP, DHCP, NAT, ICMP, UDP, DNS, TCP connections, reliability, congestion control, security, QUIC and troubleshooting.
Quiz: Modern Transports and Troubleshooting (TCP/IP Part 14)
Review modern transports and troubleshooting: QUIC packets, handshakes, 0-RTT, streams and connection migration, HTTP/3, Multipath TCP, SCTP multihoming, and a layered method for diagnosing real network faults.
Discussion
Sign in to ask a question or share what you learned.