The idea: a port that opens only after login
Anyone can walk into an office and plug a laptop into a wall socket. Without protection, that laptop gets an IP address and reaches the internal network at once. IEEE 802.1X (port-based network access control) closes the switch port until the device has logged in. The switch asks for credentials, passes them to a central RADIUS server, and opens the port only when the server says yes.
There are three roles. The supplicant is the software on the device that logs in (for example wpa_supplicant). The authenticator is the switch: it controls the port. The authentication server is the RADIUS server: it holds the user database and decides. The switch is a RADIUS client and never checks a password itself.
The uncontrolled and the controlled port
802.1X splits one physical port into two logical halves.
- The uncontrolled port always passes EAPOL frames (EAP over LAN, EtherType 0x888E), and nothing else. That is how the login itself gets through.
- The controlled port passes all other traffic: DHCP, ARP, IP. It starts Unauthorized (closed) and becomes Authorized (open) only after an Access-Accept.
In Demo 1 the laptop is plugged in but has not logged in. Its DHCP Discover is dropped at the controlled port. No address, no ARP, no way in.
EAP inside EAPOL, EAP inside RADIUS
EAP (Extensible Authentication Protocol, RFC 3748) is a small request/response protocol: the server sends an EAP-Request, the device answers an EAP-Response, and the server ends with EAP-Success or EAP-Failure. Each EAP packet has an Identifier that pairs a response with its request. EAP itself does not say how to carry it, so 802.1X carries it twice:
- on the cable, in EAPOL frames between the laptop and the switch;
- on the network, in the EAP-Message attribute of RADIUS packets (RFC 3579) between the switch and the server, UDP port 1812.
The switch adds its own attributes to each Access-Request: User-Name, NAS-Port, Calling-Station-Id (the device's MAC address) and a Message-Authenticator, a keyed hash made with the secret the switch shares with the server. The server ignores requests from switches that do not know the secret.
The page uses the simplest EAP method, EAP-MD5-Challenge, because it needs only one round: the server sends a random challenge, and the laptop answers with a hash of the Identifier, the password and the challenge. The values on the canvas are toy values. Real networks use EAP-TLS (certificates on both sides) or PEAP (a password inside a TLS tunnel). Those take several Access-Challenge rounds, but the switch relays them in exactly the same way (Demo 2).
Accept, Challenge, Reject and the VLAN
| RADIUS reply | What it means | What the switch does |
|---|---|---|
| Access-Challenge | "one more round": it carries the next EAP-Request and a State attribute | relays the EAP-Request to the laptop in EAPOL |
| Access-Accept | logged in; carries EAP-Success and optional authorization attributes | relays EAP-Success, opens the controlled port, sets the VLAN |
| Access-Reject | not logged in; carries EAP-Failure | relays EAP-Failure, keeps the port closed, waits quiet-period (60 s) |
A reply always carries the Identifier of the request it answers: Access-Request id 8 gets Access-Accept id 8. The
Accept can also say where the device goes. Three attributes from RFC 3580 do it:
Tunnel-Type = VLAN (13), Tunnel-Medium-Type = IEEE-802 (6) and
Tunnel-Private-Group-ID = 10. The switch makes the port an access port in VLAN 10. This is
dynamic VLAN assignment: the VLAN follows the user, not the socket. alice lands in the staff
VLAN wherever she plugs in, a printer lands in the printers VLAN.
In Demo 3 the password is wrong. The server's own computation gives 7b1e09aa, the laptop sent c04d5e11, so the answer is Access-Reject. The port stays closed, and the switch does not try again for quiet-period (60 s), which slows down guessing. In Demo 4 the switch has an on-reject policy: a rejected device is put in a restricted VLAN (VLAN 30, internet only). The server still said no; it is the switch that decides to give the device a fenced corner rather than nothing.
No supplicant: timeouts and MAB
Printers, cameras and badge readers often have no 802.1X supplicant. They never answer EAPOL. The switch sends EAP-Request/Identity, waits tx-period (30 s), tries again, and gives up after 1 + max-reauth-req (2) = 3 tries, at t = 90 s.
Then it falls back to MAB (MAC Authentication Bypass). The switch has seen the device's MAC address in the frames it dropped, and sends an Access-Request whose User-Name is that MAC, with no EAP inside. If the MAC is on the server's list, the answer is Access-Accept, here for VLAN 20 (Demo 5). A MAC address is not a secret: anyone can copy it. So MAB devices should only get a narrow VLAN that reaches what they need.
Accounting
RADIUS also keeps a record. When the port opens, the switch sends an Accounting-Request with
Acct-Status-Type = Start to UDP 1813 (RFC 2866); the server answers Accounting-Response. When the link
goes down, a Stop follows with Acct-Session-Time and
Acct-Terminate-Cause = Lost-Carrier. In Demo 6 alice works for 3600 s and pulls the cable:
the Stop says 3600, and the port is closed again, so the next device must log in on its own.
Why it helps, and where it stops
- An unknown device gets nothing: not even a DHCP address.
- Users and devices are managed in one place. Disabling an account closes every port it could use.
- The VLAN comes from the server, so policy follows the identity.
- It checks who connects, not what they do afterwards: firewalls between VLANs still matter.
- Weak spots: MAB (copyable MACs), EAP methods without server certificate checks, and a hub or switch placed behind an authorized port (stricter host modes limit how many MACs a port accepts).
See also VLANs: One Switch, Several Networks for access ports and 802.1Q tags, How Ethernet Switches Forward Frames for what the switch does once the port is open, How a Device Gets an IP Address for the Discover that the closed port drops, TLS Certificate Chain and Revocation for what EAP-TLS checks, and How Kerberos Works for another way a central server vouches for a user.
See also Rapid Spanning Tree vs Classic STP for how switch ports decide whether to forward once loops are taken into account.
What the page leaves out
- The inside of EAP-TLS, PEAP and EAP-TTLS (the TLS handshake and its many Access-Challenge rounds), and the keys they derive. EAP-MD5 is shown only because it is short; it has no mutual authentication and should not be used.
- Wi-Fi: WPA2/WPA3-Enterprise uses the same 802.1X and RADIUS exchange, then derives encryption keys from it.
- MACsec (802.1AE) encryption of the wired link after login.
- Reauthentication timers, RADIUS server timeouts and failover, critical VLANs when no server answers, Change of Authorization (RFC 5176), and downloadable ACLs.
- Multi-host and multi-auth host modes, phones on a voice VLAN, and vendors' counts of failures before a restricted VLAN; vendors also differ in what they tell the supplicant there.