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:

  1. EAP-MSCHAPv2 success (22 frames): EAPOL, EAP inside RADIUS, mutual authentication, Access-Accept, then DHCP.
  2. 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 roleIn these capturesTalksOver
Supplicant: the device asking for accessR1, MAC aa:bb:cc:00:01:00To the authenticatorEAPOL, directly on Ethernet
Authenticator: the switch port, also called the NASR3, port Ethernet0/0, IP 10.0.0.254To bothEAPOL toward R1, RADIUS toward the server
Authentication serverFreeRADIUS 3.0.16 at 10.0.0.100To the authenticator onlyRADIUS 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:

stateDiagram-v2 accTitle: 802.1X port state in the two captures accDescr: The port starts unauthorized and passes only EAPOL. An EAPOL-Start begins authentication. An Access-Accept with EAP-Success makes the port authorized and DHCP gets through. An Access-Reject with EAP-Failure leaves it unauthorized and DHCP Discovers are dropped. [*] --> Unauthorized Unauthorized --> Authenticating: EAPOL-Start Authenticating --> Authorized: Access-Accept, EAP-Success Authenticating --> Unauthorized: Access-Reject, EAP-Failure Authorized --> [*]: DHCP answered
R3's port Ethernet0/0 as the two captures show it. Only the RADIUS result moves it.

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:

The first Access-Request shows all of this. R3 wraps R1's EAP-Response/Identity and adds what it knows about the port:

🔐 [00004] Frame 4 RADIUS Access-Request 2020-08-05T18:49:55.95648Z 🔒 Authenticator R3 → 🗄 RADIUS server
frame : Frame 4: Packet, 284 bytes on wire (2272 bits), 284 bytes captured (2272 bits) on interface -, id 0
Section number : 1
Interface id : 0 (-)
Interface name : -
Encapsulation type : Ethernet (1)
Arrival Time : Aug 6, 2020 00:19:55.956480000 India Standard Time
UTC Arrival Time : Aug 5, 2020 18:49:55.956480000 UTC
Epoch Arrival Time : 1596653395.956480000
Time shift for this packet : 0.000000000 seconds
Time delta from previous captured frame : 767.000 microseconds
Time delta from previous displayed frame : 767.000 microseconds
Time since reference or first frame : 7.710000 milliseconds
Frame Number : 4
Frame Length : 284 bytes (2272 bits)
Capture Length : 284 bytes (2272 bits)
Frame is marked : False
Frame is ignored : False
Protocols in frame : eth:ethertype:ip:udp:radius:eap
Character encoding : ASCII (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
Destination (resolved) : 4e:a9:26:28:e1:b3
Destination OUI : 4e:a9:26
.... ..1. .... .... .... .... = LG bit : Locally administered address (this is NOT the factory default)
.... ...0 .... .... .... .... = IG bit : Individual address (unicast)
Address : 4e:a9:26:28:e1:b3
Address (resolved) : 4e:a9:26:28:e1:b3
Address OUI : 4e:a9:26
.... ..1. .... .... .... .... = LG bit : Locally administered address (this is NOT the factory default)
.... ...0 .... .... .... .... = IG bit : Individual address (unicast)
Source : aa:bb:cc:80:03:00
Source (resolved) : aa:bb:cc:80:03:00
Source OUI : aa:bb:cc
.... ..1. .... .... .... .... = LG bit : Locally administered address (this is NOT the factory default)
.... ...0 .... .... .... .... = IG bit : Individual address (unicast)
Address : aa:bb:cc:80:03:00
Address (resolved) : aa:bb:cc:80:03:00
Address OUI : aa:bb:cc
.... ..1. .... .... .... .... = LG bit : Locally administered address (this is NOT the factory default)
.... ...0 .... .... .... .... = IG bit : Individual address (unicast)
Type : IPv4 (0x0800)
Stream index : 2
ip : Internet Protocol Version 4, Src: 10.0.0.254, Dst: 10.0.0.100
0100 .... = Version : 4
.... 0101 = Header Length : 20 bytes (5)
Differentiated Services Field : 0x00 (DSCP: CS0, ECN: Not-ECT)
0000 00.. = Differentiated Services Codepoint : Default (0)
.... ..00 = Explicit Congestion Notification : Not ECN-Capable Transport (0)
Total Length : 270
Identification : 0x0024 (36)
000. .... = Flags : 0x0
0... .... = Reserved bit : Not set
.0.. .... = Don't fragment : Not set
..0. .... = More fragments : Not set
...0 0000 0000 0000 = Fragment Offset : 0
Time to Live : 255
Protocol : UDP (17)
Header Checksum : 0xa559 [validation disabled]
Header checksum status : Unverified
Source Address : 10.0.0.254
Source or Destination Address : 10.0.0.254
Source Host : 10.0.0.254
Source or Destination Host : 10.0.0.254
Destination Address : 10.0.0.100
Source or Destination Address : 10.0.0.100
Destination Host : 10.0.0.100
Source or Destination Host : 10.0.0.100
Stream index : 0
udp : User Datagram Protocol, Src Port: 1645, Dst Port: 1812
Source Port : 1645
Destination Port : 1812
Source or Destination Port : 1645
Source or Destination Port : 1812
Length : 250
Checksum : 0x4c7a [unverified]
Checksum Status : Unverified
Stream index : 0
Stream Packet Number : 1
Timestamps
Time since first frame : 0.000000000 seconds
Time since previous frame : 0.000000000 seconds
UDP payload (242 bytes)
radius : RADIUS Protocol
Code : Access-Request (1)
Packet identifier : 0xc (12)
Length : 242
Authenticator : 997295d868ce2c5acde6512c400af74d
Request : True
Attribute Value Pairs
AVP : t=User-Name(1) l=7 val=alice
Type : 1
Length : 7
User-Name : alice
AVP : t=Service-Type(6) l=6 val=Framed-User(2)
Type : 6
Length : 6
Service-Type : Framed-User (2)
AVP : t=Vendor-Specific(26) l=27 vnd=ciscoSystems(9)
Type : 26
Length : 27
Vendor ID : ciscoSystems (9)
VSA : t=Cisco-AVPair(1) l=21 val=service-type=Framed
Type : 1
Length : 21
Cisco-AVPair : service-type=Framed
AVP : t=Framed-MTU(12) l=6 val=1500
Type : 12
Length : 6
Framed-MTU : 1500
AVP : t=Called-Station-Id(30) l=19 val=AA-BB-CC-00-03-00
Type : 30
Length : 19
Called-Station-Id : AA-BB-CC-00-03-00
AVP : t=Calling-Station-Id(31) l=19 val=AA-BB-CC-00-01-00
Type : 31
Length : 19
Calling-Station-Id : AA-BB-CC-00-01-00
AVP : t=EAP-Message(79) l=12 Last Segment[1]
Type : 79
Length : 12
EAP fragment : 0205000a01616c696365
Extensible Authentication Protocol
Code : Response (2)
Id : 5
Length : 10
Type : Identity (1)
Identity : alice
AVP : t=Message-Authenticator(80) l=18 val=ae0ec3da899abf4c8cd19756e72d23ac
Type : 80
Length : 18
Message-Authenticator : ae0ec3da899abf4c8cd19756e72d23ac
AVP : t=EAP-Key-Name(102) l=2 val=[wrong length]
Type : 102
Length : 2
AVP : t=Vendor-Specific(26) l=49 vnd=ciscoSystems(9)
Type : 26
Length : 49
Vendor ID : ciscoSystems (9)
VSA : t=Cisco-AVPair(1) l=43 val=audit-session-id=0A0000FE0000000F0041BF48
Type : 1
Length : 43
Cisco-AVPair : audit-session-id=0A0000FE0000000F0041BF48
AVP : t=Vendor-Specific(26) l=20 vnd=ciscoSystems(9)
Type : 26
Length : 20
Vendor ID : ciscoSystems (9)
VSA : t=Cisco-AVPair(1) l=14 val=method=dot1x
Type : 1
Length : 14
Cisco-AVPair : method=dot1x
AVP : t=Framed-IP-Address(8) l=6 val=10.0.0.1
Type : 8
Length : 6
Framed-IP-Address : 10.0.0.1
AVP : t=NAS-IP-Address(4) l=6 val=10.0.0.254
Type : 4
Length : 6
NAS-IP-Address : 10.0.0.254
AVP : t=NAS-Port-Id(87) l=13 val=Ethernet0/0
Type : 87
Length : 13
NAS-Port-Id : Ethernet0/0
AVP : t=NAS-Port-Type(61) l=6 val=Ethernet(15)
Type : 61
Length : 6
NAS-Port-Type : Ethernet (15)
AVP : t=NAS-Port(5) l=6 val=50000
Type : 5
Length : 6
NAS-Port : 50000
Rendered from a Wireshark PCAP by VisualEther.

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.

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.

sequenceDiagram accTitle: Successful 802.1X login with EAP-MSCHAPv2 accDescr: The supplicant sends EAPOL-Start and its identity alice. The switch relays it to the RADIUS server, which proposes EAP-MD5. The supplicant answers with a Legacy Nak asking for MSCHAPv2. The server sends an MSCHAPv2 Challenge, the supplicant a Response, and the server a Success Request inside an Access-Challenge. The supplicant acknowledges, the server sends Access-Accept with EAP-Success, and DHCP then completes. participant S as Supplicant R1 participant A as Switch R3 participant R as RADIUS server S->>A: [1] EAPOL-Start A->>S: [2] EAP-Request/Identity S->>A: [3] EAP-Response/Identity, alice A->>R: [4] Access-Request, identity R->>A: [5] Access-Challenge, EAP-MD5 S->>A: [7] Legacy Nak, wants MSCHAPv2 A->>R: [8] Access-Request, Legacy Nak R->>A: [9] Access-Challenge, MS-CHAPv2 Challenge S->>A: [11] MS-CHAPv2 Response R->>A: [13] Access-Challenge, MS-CHAPv2 Success Request S->>A: [15] MS-CHAPv2 Success Response R->>A: [17] Access-Accept, EAP-Success A->>S: [18] EAP-Success, port authorized S->>A: [19] to [22] DHCP Discover, Offer, Request, ACK
The success capture at a glance. Frame numbers are in brackets.

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):

  1. Challenge (OpCode 1), frames 9 and 10. The server sends 16 random bytes and its name, freeradius-3.0.16.
  2. 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.
  3. 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).
  4. 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 captureFailure capture
Frames 1 to 12EAP Ids 5 to 7, RADIUS Identifiers 12 to 14EAP Ids 1 to 3, RADIUS Identifiers 22 to 24
Frame 13Access-Challenge, 0.3 ms after the requestAccess-Reject, 1.002 s after the request
EAP inside frame 13EAP-Request, MS-CHAPv2 Success RequestEAP-Failure
Error attributenoneMS-CHAP-Error E=691 R=1
Frame 14EAP-Request, MS-CHAPv2 Success, to R1EAP-Failure, to R1
Port afterwardAuthorizedUnauthorized
DHCPDiscover answered, 10.0.0.2 leased3 Discovers, no reply
sequenceDiagram accTitle: Failed 802.1X login with EAP-MSCHAPv2 accDescr: The supplicant sends its MSCHAPv2 Response, which the switch relays in an Access-Request. One second later the server sends Access-Reject with MS-CHAP-Error 691 and an EAP-Failure. The switch forwards only the EAP-Failure. The supplicant's three DHCP Discovers get no answer. participant S as Supplicant R1 participant A as Switch R3 participant R as RADIUS server S->>A: [11] MS-CHAPv2 Response A->>R: [12] Access-Request, MS-CHAPv2 Response Note over R: 1 s reject delay R->>A: [13] Access-Reject, MS-CHAP-Error 691, EAP-Failure A->>S: [14] EAP-Failure, port stays unauthorized S--xA: [15] [16] [17] DHCP Discover, dropped
The failure capture from frame 11. Frame numbers are in brackets.

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):

🚫 [00013] Frame 13 RADIUS Access-Reject 2020-08-05T18:56:18.80698Z 🗄 RADIUS server → 🔒 Authenticator R3
frame : Frame 13: Packet, 169 bytes on wire (1352 bits), 169 bytes captured (1352 bits) on interface -, id 0
Section number : 1
Interface id : 0 (-)
Interface name : -
Encapsulation type : Ethernet (1)
Arrival Time : Aug 6, 2020 00:26:18.806980000 India Standard Time
UTC Arrival Time : Aug 5, 2020 18:56:18.806980000 UTC
Epoch Arrival Time : 1596653778.806980000
Time shift for this packet : 0.000000000 seconds
Time delta from previous captured frame : 1.002200000 seconds
Time delta from previous displayed frame : 1.002200000 seconds
Time since reference or first frame : 1.012571000 seconds
Frame Number : 13
Frame Length : 169 bytes (1352 bits)
Capture Length : 169 bytes (1352 bits)
Frame is marked : False
Frame is ignored : False
Protocols in frame : eth:ethertype:ip:udp:radius:eap
Character encoding : ASCII (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
Destination (resolved) : aa:bb:cc:80:03:00
Destination OUI : aa:bb:cc
.... ..1. .... .... .... .... = LG bit : Locally administered address (this is NOT the factory default)
.... ...0 .... .... .... .... = IG bit : Individual address (unicast)
Address : aa:bb:cc:80:03:00
Address (resolved) : aa:bb:cc:80:03:00
Address OUI : aa:bb:cc
.... ..1. .... .... .... .... = LG bit : Locally administered address (this is NOT the factory default)
.... ...0 .... .... .... .... = IG bit : Individual address (unicast)
Source : 4e:a9:26:28:e1:b3
Source (resolved) : 4e:a9:26:28:e1:b3
Source OUI : 4e:a9:26
.... ..1. .... .... .... .... = LG bit : Locally administered address (this is NOT the factory default)
.... ...0 .... .... .... .... = IG bit : Individual address (unicast)
Address : 4e:a9:26:28:e1:b3
Address (resolved) : 4e:a9:26:28:e1:b3
Address OUI : 4e:a9:26
.... ..1. .... .... .... .... = LG bit : Locally administered address (this is NOT the factory default)
.... ...0 .... .... .... .... = IG bit : Individual address (unicast)
Type : IPv4 (0x0800)
Stream index : 2
ip : Internet Protocol Version 4, Src: 10.0.0.100, Dst: 10.0.0.254
0100 .... = Version : 4
.... 0101 = Header Length : 20 bytes (5)
Differentiated Services Field : 0x00 (DSCP: CS0, ECN: Not-ECT)
0000 00.. = Differentiated Services Codepoint : Default (0)
.... ..00 = Explicit Congestion Notification : Not ECN-Capable Transport (0)
Total Length : 155
Identification : 0xc1b6 (49590)
000. .... = Flags : 0x0
0... .... = Reserved bit : Not set
.0.. .... = Don't fragment : Not set
..0. .... = More fragments : Not set
...0 0000 0000 0000 = Fragment Offset : 0
Time to Live : 64
Protocol : UDP (17)
Header Checksum : 0xa33a [validation disabled]
Header checksum status : Unverified
Source Address : 10.0.0.100
Source or Destination Address : 10.0.0.100
Source Host : 10.0.0.100
Source or Destination Host : 10.0.0.100
Destination Address : 10.0.0.254
Source or Destination Address : 10.0.0.254
Destination Host : 10.0.0.254
Source or Destination Host : 10.0.0.254
Stream index : 0
udp : User Datagram Protocol, Src Port: 1812, Dst Port: 1645
Source Port : 1812
Destination Port : 1645
Source or Destination Port : 1812
Source or Destination Port : 1645
Length : 135
Checksum : 0x22fb [unverified]
Checksum Status : Unverified
Stream index : 0
Stream Packet Number : 6
Timestamps
Time since first frame : 1.010851000 seconds
Time since previous frame : 1.002200000 seconds
UDP payload (127 bytes)
radius : RADIUS Protocol
Code : Access-Reject (3)
Packet identifier : 0x18 (24)
Length : 127
Authenticator : dd03da445f0df1661685c88826ec8c57
Response : True
This is a response to a request in frame 12
Time from request : 1.002200000 seconds
Attribute Value Pairs
AVP : t=Vendor-Specific(26) l=83 vnd=Microsoft(311)
Type : 26
Length : 83
Vendor ID : Microsoft (311)
VSA : t=MS-CHAP-Error(2) l=77 val=\003E=691 R=1 C=aff4bfbd9c76e14e8d9406295ecc6b05 V=3 M=Authentication rejected
Type : 2
Length : 77
MS-CHAP-Error : \x03E=691 R=1 C=aff4bfbd9c76e14e8d9406295ecc6b05 V=3 M=Authentication rejected
AVP : t=EAP-Message(79) l=6 Last Segment[1]
Type : 79
Length : 6
EAP fragment : 04030004
Extensible Authentication Protocol
Code : Failure (4)
Id : 3
Length : 4
AVP : t=Message-Authenticator(80) l=18 val=174f3a6627bf23a0d5d1ddd5cdf0978d
Type : 80
Length : 18
Message-Authenticator : 174f3a6627bf23a0d5d1ddd5cdf0978d
Rendered from a Wireshark PCAP by VisualEther.

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:

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 EAPPlain RADIUS login
RADIUS packets8 (success), 6 (failure)2
Password on the wireNever: MSCHAPv2 sends a hash computed from itUser-Password, hidden with an MD5 of the shared secret (RFC 2865 section 5.2)
Server's replyAccess-Challenge rounds, then Accept or RejectAccess-Accept or Access-Reject at once
Message-AuthenticatorIn every packetAbsent
Reject delay1.002 s1.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:

  1. 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.
  2. EAP Identity, but no Access-Request. The switch isn't sending RADIUS: check its RADIUS server and port configuration.
  3. 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-Authenticator and must drop the packet (RFC 3579 section 3.2).
  4. A Legacy Nak, then Access-Reject. The supplicant and the server share no EAP method.
  5. 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-Error 691, exists only there.
  6. 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

  1. The switch is a relay. It copies EAP into RADIUS EAP-Message attributes and back, and decides only on the RADIUS code.
  2. State and Message-Authenticator hold the conversation together. One ties each round to the last; the other proves each packet came from a holder of the shared secret.
  3. Method negotiation costs a round trip. The server offered MD5, and the supplicant answered with a Nak for MSCHAPv2.
  4. Success needs two extra messages. MSCHAPv2 authenticates both ways, so the Access-Accept comes only after the supplicant checks the server's proof.
  5. The failure reason stays on the server side. MS-CHAP-Error 691 is in the Access-Reject; the supplicant gets a bare EAP-Failure.
  6. A one-second pause before a reject is deliberate. FreeRADIUS's reject_delay slows down password guessing.
  7. An unauthorized port drops DHCP. Three Discovers, no Offer: the classic symptom of a failed 802.1X login.