802.1X Authentication with RADIUS: A Success and a Failure, Packet by Packet
This walkthrough uses captures from the late Nick Russo's free packet-capture library. They are in the AAA archive, aaa_pcap.zip, under aaa_pcap/: dot1x_mschapv2_success.pcapng, dot1x_mschapv2_failure.pcapng, radius_authc_success.pcapng, and radius_authc_failure.pcapng. The archive is preserved by the Internet Archive, with the rest of the library listed on his job aid page. We decoded the captures with VisualEther, which turns a Wireshark PCAP into a sequence diagram with a plain-English caption on every message.
IEEE 802.1X keeps a switch port closed until the device plugged into it proves who it is. Until then the port passes only authentication frames: no DHCP, no ARP, no traffic of any kind. The switch doesn't check the credentials itself. It relays them to a RADIUS server and opens the port only if the server says yes.
These two captures record the same lab login twice, once with the right password and once with a wrong one. The device is router R1, logging in as alice; router R3 plays the switch; the server is FreeRADIUS 3.0.16. The two runs are identical for 12 frames. At frame 13 one gets a challenge that leads to an Access-Accept and a DHCP address, and the other gets an Access-Reject and a port that stays shut.
Both captures are drawn as annotated sequence diagrams:
- EAP-MSCHAPv2 success (22 frames): EAPOL, EAP inside RADIUS, mutual authentication, Access-Accept, then DHCP.
- EAP-MSCHAPv2 failure (17 frames): the same exchange up to an Access-Reject, then three unanswered DHCP Discovers.
Each participant gets a lane, and each message is an arrow, numbered as in Wireshark and captioned with what it does. Every diagram comes in three forms: an interactive viewer, an HTML page, and a printable PDF. In the viewer and the HTML page, clicking any message opens its full Wireshark field tree.
💡 Read the walkthrough and a diagram side by side: open the interactive diagram in a split-screen window, or open the HTML version in a new tab and snap the two windows side by side. Each capture section below links its own diagram.
Who talks to whom in 802.1X?
Three parties, on two links, speaking two protocols:
| 802.1X role | In these captures | Talks | Over |
|---|---|---|---|
| Supplicant: the device asking for access | R1, MAC aa:bb:cc:00:01:00 | To the authenticator | EAPOL, directly on Ethernet |
| Authenticator: the switch port, also called the NAS | R3, port Ethernet0/0, IP 10.0.0.254 | To both | EAPOL toward R1, RADIUS toward the server |
| Authentication server | FreeRADIUS 3.0.16 at 10.0.0.100 | To the authenticator only | RADIUS over UDP 1812 |
The supplicant and the server never exchange a packet. The authenticator sits between them and translates.
EAP (Extensible Authentication Protocol, RFC 3748) is the conversation that authenticates. It is a simple lock-step protocol: the authenticator sends a Request, the peer answers with a Response carrying the same Identifier, and the authenticator ends with Success or Failure (RFC 3748 section 4). EAP carries a method inside it, such as MD5-Challenge or MSCHAPv2, and the method does the cryptography.
On the port, EAP rides in EAPOL (EAP over LAN), defined by IEEE 802.1X. EAPOL frames have their own EtherType, 0x888e, and no IP header, because the supplicant has no address yet. Toward the server, the switch copies each EAP packet into a RADIUS attribute (RADIUS is Remote Authentication Dial-In User Service, RFC 2865).
One detail makes these captures confusing in Wireshark. Every EAPOL frame, in both directions, is addressed to the 802.1X group MAC address 01:80:c2:00:00:03, not to the other party. The receiver is clear only from the EAP code: Requests, Success, and Failure always come from the authenticator; Responses always come from the supplicant. The diagrams use that rule to draw each EAP arrow to the right lane.
R3 also appears under two MAC addresses: aa:bb:cc:00:03:00 on the 802.1X port, sending EAPOL, and aa:bb:cc:80:03:00 with the IP address 10.0.0.254, sending RADIUS and DHCP. The diagrams map both to one lane.
The two captures follow the port through these states:
Why does the switch relay EAP inside RADIUS?
The switch doesn't know the authentication method and doesn't need to. RFC 3748 section 2.3 calls this pass-through: the authenticator forwards EAP packets without interpreting them, so a new authentication method needs a change only on the supplicant and the server. Every switch already speaks RADIUS to a central server, and RFC 3579 defines how EAP rides in it.
Four RADIUS details carry the EAP conversation:
EAP-Message(attribute 79) holds the EAP packet byte for byte (RFC 3579 section 3.1).Access-Challenge(code 11) is the server saying "not finished, pass this EAP-Request on" (RFC 2865 section 4.4). Every EAP-Request after R3's own opening Identity request reaches the switch in one.State(attribute 24) is an opaque cookie the server puts in each Access-Challenge. The switch must copy it into its next Access-Request, so the server can find the conversation again (RFC 2865 section 5.24). In these captures it changes every round.Message-Authenticator(attribute 80) is an HMAC-MD5 of the whole packet, keyed with the secret the switch and server share. RFC 3579 section 3.2 makes it mandatory in every packet that carriesEAP-Message, and all 14 RADIUS packets in the two captures have it.
The first Access-Request shows all of this. R3 wraps R1's EAP-Response/Identity and adds what it knows about the port:
frame : Frame 4: Packet, 284 bytes on wire (2272 bits), 284 bytes captured (2272 bits) on interface -, id 0
Interface id : 0 (-)
eth : Ethernet II, Src: aa:bb:cc:80:03:00, Dst: 4e:a9:26:28:e1:b3
Destination : 4e:a9:26:28:e1:b3
Source : aa:bb:cc:80:03:00
ip : Internet Protocol Version 4, Src: 10.0.0.254, Dst: 10.0.0.100
Differentiated Services Field : 0x00 (DSCP: CS0, ECN: Not-ECT)
000. .... = Flags : 0x0
udp : User Datagram Protocol, Src Port: 1645, Dst Port: 1812
Timestamps
radius : RADIUS Protocol
Attribute Value Pairs
AVP : t=User-Name(1) l=7 val=alice
AVP : t=Service-Type(6) l=6 val=Framed-User(2)
AVP : t=Vendor-Specific(26) l=27 vnd=ciscoSystems(9)
VSA : t=Cisco-AVPair(1) l=21 val=service-type=Framed
AVP : t=Framed-MTU(12) l=6 val=1500
AVP : t=Called-Station-Id(30) l=19 val=AA-BB-CC-00-03-00
AVP : t=Calling-Station-Id(31) l=19 val=AA-BB-CC-00-01-00
AVP : t=EAP-Message(79) l=12 Last Segment[1]
Extensible Authentication Protocol
AVP : t=Message-Authenticator(80) l=18 val=ae0ec3da899abf4c8cd19756e72d23ac
AVP : t=EAP-Key-Name(102) l=2 val=[wrong length]
AVP : t=Vendor-Specific(26) l=49 vnd=ciscoSystems(9)
VSA : t=Cisco-AVPair(1) l=43 val=audit-session-id=0A0000FE0000000F0041BF48
AVP : t=Vendor-Specific(26) l=20 vnd=ciscoSystems(9)
VSA : t=Cisco-AVPair(1) l=14 val=method=dot1x
AVP : t=Framed-IP-Address(8) l=6 val=10.0.0.1
AVP : t=NAS-IP-Address(4) l=6 val=10.0.0.254
AVP : t=NAS-Port-Id(87) l=13 val=Ethernet0/0
AVP : t=NAS-Port-Type(61) l=6 val=Ethernet(15)
AVP : t=NAS-Port(5) l=6 val=50000
Success capture, frame 4, the first Access-Request. Under RADIUS: Identifier 12, User-Name alice, the EAP-Message attribute with the EAP-Response/Identity inside, Message-Authenticator, NAS-Port-Id Ethernet0/0, NAS-Port-Type Ethernet, Calling-Station-Id (R1's MAC), and Called-Station-Id (R3's port MAC). The Cisco-AVPair attributes carry method=dot1x and the session ID.
Calling-Station-IdAA-BB-CC-00-01-00is the supplicant's MAC, andCalled-Station-IdAA-BB-CC-00-03-00the switch port's. Servers often key policy on them.NAS-Port-TypeEthernet(15) andNAS-Port-IdEthernet0/0say which port the user is on. A RADIUS server log line with these two fields tells you which switch port to look at.- The Cisco
audit-session-id,0A0000FE0000000F0041BF48, starts with R3's address 10.0.0.254 in hex. The same ID appears in both captures, so R3 treated both logins as one session on that port. - R3 sends to the server's UDP port 1812 from source port 1645, the port RADIUS used before 1812 was assigned (RFC 2865 section 3).
The RADIUS Identifier (12 here) pairs each request with its reply. It is separate from the EAP Identifier inside (5 here), which pairs EAP Requests and Responses end to end.
Why does the server offer EAP-MD5 first, and what is a Legacy Nak?
The server proposes a method, and the peer may refuse it. FreeRADIUS starts with MD5-Challenge because that is its configured default (default_eap_type = md5), and RFC 3748 section 5.4 requires every EAP peer and server to support MD5. R1 isn't set up for MD5, so it answers with a Nak naming the method it wants: type 26, EAP-MSCHAPv2. Wireshark labels type 26 "MS-Authentication EAP".
A Nak (type 3) is valid only as a Response and only to propose other methods (RFC 3748 section 5.3.1). "Legacy" distinguishes it from the Expanded Nak (type 254), which names vendor-specific methods.
This round trip costs about 2 ms and happens on every login here. Setting the server's default EAP type to the method your supplicants use removes it. EAP-MD5 is a poor choice anyway: it authenticates only the client and exposes the password to offline dictionary attacks (RFC 3748 sections 7.6 and 7.7).
The successful login, step by step
The whole login takes 27 ms, and R1 has an IP address 4 seconds after its first frame.
How does MSCHAPv2 prove the password without sending it?
Both sides prove they know the password for alice, and neither sends it. MSCHAPv2 (RFC 2759) runs inside EAP as type 26, with its own OpCode and counter (draft-kamath-pppext-eap-mschapv2, section 2):
- Challenge (OpCode 1), frames 9 and 10. The server sends 16 random bytes and its name,
freeradius-3.0.16. - Response (OpCode 2), frames 11 and 12. The supplicant sends 16 random bytes of its own and a 24-byte NT-Response, a hash computed from the password, the username, and both random values (RFC 2759 section 4). The server repeats the computation with its stored copy of the password.
- Success Request (OpCode 3), frames 13 and 14. The values matched. The server answers with
S=and 40 hex digits, an authenticator response that only a holder of the password could compute, so the supplicant can check the server too (draft section 2.3). - Success Response (OpCode 3), frames 15 and 16. The supplicant verified the server and acknowledges with a bare OpCode (draft section 2.4).
Step 3 explains why frame 13 is an Access-Challenge and not yet an Access-Accept. MSCHAPv2 authenticates both ways, so the server must let the supplicant check its proof before declaring EAP-Success.
Two oddities are visible in the trees. R1 writes a Value-Size of 16 in its Response instead of the 49 bytes RFC 2759 section 4 specifies (16 + 8 reserved + 24 + 1 flags byte), so Wireshark stops early and shows an empty name; alice follows the 49-byte value. And FreeRADIUS adds a Reply-Message "Hello, alice" to its Access-Challenges, which RFC 3579 section 2.6.5 forbids beside EAP-Message. R3 ignores it, so nothing reaches R1.
What does the Access-Accept carry?
It carries the decision, the EAP-Success for the supplicant, and keys. RFC 3579 section 2.6.3 says the switch must decide on the RADIUS code alone, and that an Access-Accept should carry EAP-Success. Here the EAP-Success has Identifier 8, matching the last Response as RFC 3748 section 4.2 requires.
The Accept also carries MS-MPPE-Send-Key and MS-MPPE-Recv-Key, key material derived from the MSCHAPv2 exchange and encrypted with the shared secret. On a wireless LAN they would seed the encryption keys; on a wired port without MACsec they go unused.
R3 relays EAP-Success to R1 7 ms later and authorizes the port. Two seconds later R1 broadcasts a DHCP Discover. R3, which is also the DHCP server and gateway, offers 10.0.0.2 with a one-day lease two seconds after that, and the exchange completes. The same pause appears in our DHCP walkthrough, where it fits the server pinging the address before offering it.
Where does the failure show up?
The runs diverge at frame 13, the server's answer to the MSCHAPv2 Response. Up to frame 12 the failed login is the successful one with different identifiers: the same EAPOL-Start, identity, MD5 offer, Nak, and Challenge. R1's MSCHAPv2 Response even has the same length and format. Only the server can tell that the NT-Response inside came from the wrong password.
| Success capture | Failure capture | |
|---|---|---|
| Frames 1 to 12 | EAP Ids 5 to 7, RADIUS Identifiers 12 to 14 | EAP Ids 1 to 3, RADIUS Identifiers 22 to 24 |
| Frame 13 | Access-Challenge, 0.3 ms after the request | Access-Reject, 1.002 s after the request |
| EAP inside frame 13 | EAP-Request, MS-CHAPv2 Success Request | EAP-Failure |
| Error attribute | none | MS-CHAP-Error E=691 R=1 |
| Frame 14 | EAP-Request, MS-CHAPv2 Success, to R1 | EAP-Failure, to R1 |
| Port afterward | Authorized | Unauthorized |
| DHCP | Discover answered, 10.0.0.2 leased | 3 Discovers, no reply |
What does the Access-Reject say?
It says more than the supplicant ever learns. The reason is in a Microsoft vendor attribute, MS-CHAP-Error (RFC 2548 section 2.1.5):
frame : Frame 13: Packet, 169 bytes on wire (1352 bits), 169 bytes captured (1352 bits) on interface -, id 0
Interface id : 0 (-)
eth : Ethernet II, Src: 4e:a9:26:28:e1:b3, Dst: aa:bb:cc:80:03:00
Destination : aa:bb:cc:80:03:00
Source : 4e:a9:26:28:e1:b3
ip : Internet Protocol Version 4, Src: 10.0.0.100, Dst: 10.0.0.254
Differentiated Services Field : 0x00 (DSCP: CS0, ECN: Not-ECT)
000. .... = Flags : 0x0
udp : User Datagram Protocol, Src Port: 1812, Dst Port: 1645
Timestamps
radius : RADIUS Protocol
Attribute Value Pairs
AVP : t=Vendor-Specific(26) l=83 vnd=Microsoft(311)
VSA : t=MS-CHAP-Error(2) l=77 val=\003E=691 R=1 C=aff4bfbd9c76e14e8d9406295ecc6b05 V=3 M=Authentication rejected
AVP : t=EAP-Message(79) l=6 Last Segment[1]
Extensible Authentication Protocol
AVP : t=Message-Authenticator(80) l=18 val=174f3a6627bf23a0d5d1ddd5cdf0978d
Failure capture, frame 13, the Access-Reject. Under RADIUS: the Vendor-Specific attribute for Microsoft (311) holding MS-CHAP-Error, the EAP-Message with a bare EAP-Failure, Id 3, and Message-Authenticator. Time from request: 1.0022 s.
The MS-CHAP-Error text follows RFC 2759 section 6:
E=691is ERROR_AUTHENTICATION_FAILURE: the NT-Response didn't match. Other codes in the same list cover restricted logon hours (646), a disabled account (647), and an expired password (648).R=1means a retry is allowed.C=is a fresh challenge for that retry, andV=3the password-change protocol version.M=Authentication rejectedis the human-readable text.
The EAP-Message beside it is a bare EAP-Failure. EAP Failure packets carry no data (RFC 3748 section 4.2), and R3 doesn't pass RADIUS attributes to the supplicant. So R1 learns only that it failed, never why.
The EAP-MSCHAPv2 specification expects better. For a retryable error it says the server MUST send an MS-CHAPv2 Failure Request (OpCode 4) carrying the same E=691 R=1 text to the peer, and allows a bare EAP-Failure only when retrying isn't allowed (draft sections 2.5 and 2.8). FreeRADIUS skips the Failure Request unless its send_error option is turned on. Its configuration file says sending it may help some clients and break others, so the default is off.
Why did the Access-Reject take a second?
FreeRADIUS holds every Access-Reject for reject_delay seconds, 1 by default, to slow down password guessing. The success capture's replies all came back in under half a millisecond; this one took 1.002 s. A one-second gap before an Access-Reject is the server's choice, not a network delay.
What happens to the port, and to DHCP, after each outcome?
The RADIUS code decides. After the Access-Accept, R3 authorized the port, and R1's DHCP Discover got an Offer. After the Access-Reject, the port stayed unauthorized, and R3 kept dropping everything from R1 except EAPOL.
The failure capture shows the effect. One second after the EAP-Failure, R1 asks for an address anyway: a DHCP Discover with transaction ID 0x1025, then the same Discover 3.5 seconds and 4 seconds later. The frames are on the wire, so the capture sees them, but R3's port discards them before they reach its DHCP server. No Offer ever comes.
That is the symptom an admin usually sees first: a device with no address, or a self-assigned 169.254.x.x one. The packets above are what to look for behind it.
RADIUS without EAP: a plain login
The other two captures show RADIUS at its simplest. R3 authenticates a login to itself (NAS-Port-Type Async, an asynchronous terminal line, not an 802.1X port) for the same user alice, in one request and one reply:
| 802.1X with EAP | Plain RADIUS login | |
|---|---|---|
| RADIUS packets | 8 (success), 6 (failure) | 2 |
| Password on the wire | Never: MSCHAPv2 sends a hash computed from it | User-Password, hidden with an MD5 of the shared secret (RFC 2865 section 5.2) |
| Server's reply | Access-Challenge rounds, then Accept or Reject | Access-Accept or Access-Reject at once |
Message-Authenticator | In every packet | Absent |
| Reject delay | 1.002 s | 1.003 s |
Reply-Message | "Hello, alice" in the Access-Challenges | "Hello, alice" in both the Accept and the Reject |
The greeting in the Reject shows that a Reply-Message is no hint of success: this server sends it whatever the outcome.
How to debug a port that won't authorize
Work along the path, from the supplicant to the server:
- No EAPOL from the supplicant. The device isn't running 802.1X, or the switch never sent an EAP-Request/Identity. Capture on the access port.
- EAP Identity, but no Access-Request. The switch isn't sending RADIUS: check its RADIUS server and port configuration.
- Access-Requests with no reply. The server is unreachable or silently discards them. A wrong shared secret causes this: the server can't verify
Message-Authenticatorand must drop the packet (RFC 3579 section 3.2). - A Legacy Nak, then Access-Reject. The supplicant and the server share no EAP method.
- Access-Reject after the method runs. Credentials or policy. Read the server's log or capture the RADIUS side: the reason, such as
MS-CHAP-Error691, exists only there. - Access-Accept, but no traffic. Authentication worked; look at what the Accept assigned, such as a VLAN or an access list.
FAQ
What are the three roles in 802.1X? The supplicant (the device that wants access), the authenticator (the switch port or wireless access point), and the authentication server (usually RADIUS). The supplicant and the server talk only through the authenticator.
What is EAPOL? EAP over LAN, the IEEE 802.1X encapsulation that carries EAP directly on Ethernet with EtherType 0x888e. It needs no IP address, which is why it works before the device has one. These captures use EAPOL version 3, from 802.1X-2010.
What is the difference between an Access-Challenge and an Access-Accept? An Access-Challenge means "not finished": it carries the next EAP-Request for the supplicant. An Access-Accept ends authentication successfully and opens the port.
What does RADIUS error 691 mean? MS-CHAP error 691, ERROR_AUTHENTICATION_FAILURE: the response computed from the password didn't match, usually a wrong password or username (RFC 2759 section 6).
Why does the supplicant not show why authentication failed? The reason travels only between the switch and the RADIUS server. EAP-Failure carries no data, and FreeRADIUS by default doesn't send the MSCHAPv2 Failure Request that would.
What UDP port does RADIUS use? 1812 for authentication and 1813 for accounting (RFC 2865 and RFC 2866). Some older equipment still uses the earlier 1645 and 1646. In these captures the server listens on 1812, and R3 sends from source port 1645.
Is EAP-MSCHAPv2 secure? Not on its own: the exchange can be captured and the password attacked offline. It is normally run inside a TLS tunnel, as PEAP or EAP-TTLS. These lab captures run it bare, which is why every field is readable.
Takeaways
- The switch is a relay. It copies EAP into RADIUS
EAP-Messageattributes and back, and decides only on the RADIUS code. StateandMessage-Authenticatorhold the conversation together. One ties each round to the last; the other proves each packet came from a holder of the shared secret.- Method negotiation costs a round trip. The server offered MD5, and the supplicant answered with a Nak for MSCHAPv2.
- Success needs two extra messages. MSCHAPv2 authenticates both ways, so the Access-Accept comes only after the supplicant checks the server's proof.
- The failure reason stays on the server side.
MS-CHAP-Error691 is in the Access-Reject; the supplicant gets a bare EAP-Failure. - A one-second pause before a reject is deliberate. FreeRADIUS's
reject_delayslows down password guessing. - An unauthorized port drops DHCP. Three Discovers, no Offer: the classic symptom of a failed 802.1X login.