SSOGEN / Learn / What is RADIUS authentication?

Learn

What is RADIUS authentication?

RADIUS authentication lets a VPN gateway ask a central server whether to admit a user. The gateway sends an Access-Request to UDP 1812 and obeys the reply: accept, reject or challenge.

Network cabinet with a VPN gateway and a RADIUS server joined by one cable carrying a sealed envelope
One request and one of three replies, each in a single UDP datagram.

A VPN gateway does not check passwords itself. It asks a RADIUS server and obeys the answer (RFC 2865, June 2000): one request and one of three replies, each in a single UDP datagram.

Standard
RFC 2865 (June 2000); accounting in RFC 2866
Ports
UDP 1812 authentication, UDP 1813 accounting
Packet types
Access-Request 1, Access-Accept 2, Access-Reject 3, Access-Challenge 11

One VPN sign-in with a one-time code

A one-time code adds a second request and a challenge to the password check (RFC 2865, section 4.4).

A VPN sign-in with a one-time code: two Access-Requests, one Access-Challenge, one Access-Accept

  • MariaVPN client
  • VPN gatewayRADIUS client, 192.0.2.10
  • RADIUS serverUDP 1812
  1. Maria to VPN gateway1Enters username and password
  2. VPN gateway to RADIUS server2Access-Request (1), Identifier 7User-Name, NAS-IP-Address and a User-Password hidden with the shared secret.
  3. RADIUS server to VPN gateway3Access-Challenge (11), Identifier 7Reply-Message asks for the one-time code. State holds the server cookie.
  4. VPN gateway to Maria4Shows the prompt: Enter your one-time code.
  5. Maria to VPN gateway5Types the code
  6. VPN gateway to RADIUS server6Access-Request (1), Identifier 8, State returnedNew Identifier and Request Authenticator. User-Password now holds the code.
  7. RADIUS server to VPN gateway7Access-Accept (2), Identifier 8Framed-IP-Address and Session-Timeout. The gateway opens the tunnel for Maria.
A constructed example that follows RFC 2865, sections 2 and 4.4. It is not a capture of a real session.

Who talks to whom in RADIUS authentication?

Role What it does
User Types credentials into the VPN client and never speaks RADIUS.
Network access server (NAS) The VPN gateway here. It is the RADIUS client: it passes the user’s details to the server and acts on the reply (RFC 2865, section 1).
RADIUS server Accepts a request only from a client whose shared secret it holds, which it picks by the packet’s source IP address (section 3). One reply covers authentication and authorization.
User database The store the server consults for the user’s entry and requirements (section 2). It can be a directory; see LDAP ports.

The four RADIUS packets, field by field

Every packet starts with the same 20 octets, then attributes, each a type, a length and a value.

Header field Size What it does
Code 1 octet Names the packet: 1, 2, 3 or 11 here (RFC 2865, section 3)
Identifier 1 octet Matches a reply to its request
Length 2 octets Whole packet length, 20 to 4096
Authenticator 16 octets Request Authenticator in a request; Response Authenticator in a reply

Values are fictional.

1. Access-Requestto UDP 1812
Field Example value In a capture
Code, Identifier, Length 1, 7, 76 Readable
Request Authenticator 16 random octets Readable
User-Name (1) maria@acme.example Readable
User-Password (2) 16 octets Hidden: XORed with MD5(secret + Request Authenticator)
NAS-IP-Address (4) 192.0.2.10 Readable
Service-Type (6) 2 (Framed) Readable
NAS-Port-Type (61) 5 (Virtual) Readable
2. Access-Challengefrom UDP 1812
Field Example value In a capture
Code, Identifier, Length 11, 7, 63 Readable
Response Authenticator 16 octets, see the formula below Readable
Reply-Message (18) Enter your one-time code. Readable
State (24) 8 opaque octets Readable
Session-Timeout (27) 60 seconds Readable
3. Access-Request againto UDP 1812
Field Example value In a capture
Code, Identifier, Length 1, 8, 86 Readable
Request Authenticator 16 new random octets Readable
User-Name (1) maria@acme.example Readable
User-Password (2) 16 octets holding the code Hidden: XORed with MD5(secret + new Request Authenticator)
State (24) the same 8 octets as in packet 2 Readable
NAS-IP-Address, Service-Type, NAS-Port-Type as in packet 1 Readable
4. Access-Acceptfrom UDP 1812
Field Example value In a capture
Code, Identifier, Length 2, 8, 48 Readable
Response Authenticator 16 octets Readable
Service-Type (6) 2 (Framed) Readable
Framed-IP-Address (8) 198.51.100.40 Readable
Session-Timeout (27) 28800 seconds Readable
Class (25) 8 opaque octets Readable

If the code were wrong, packet 4 would be an Access-Reject: Code 3, the same Identifier and an optional Reply-Message. The gateway ends the sign-in (RFC 2865, section 4.3).

How the server proves the answer is its own

The server shares a secret with the gateway, and the secret never crosses the network (RFC 2865, section 1). Four fields turn that secret into proof.

  • Request Authenticator. Sixteen random octets, unpredictable and unique over the life of the secret (section 3).
  • Response Authenticator. MD5(Code+ID+Length+RequestAuth+Attributes+Secret), where + is concatenation (section 3). Only a server that holds the secret can compute it, and the gateway discards a reply that fails the check (section 4.2).
  • User-Password. Padded with nulls to a multiple of 16 octets, then XORed with MD5(secret + Request Authenticator). Passwords run up to 128 characters (section 5.2). Every other attribute is readable.
  • Message-Authenticator. Attribute 80, an HMAC-MD5 over the packet keyed with the secret. It protects requests without a User-Password, such as EAP (RFC 2869, section 5.14; RFC 3579, section 3.2).

What is a RADIUS server, and which ports does it use?

A RADIUS server is the process that receives Access-Requests from network access servers, checks each user against its database and replies Accept, Reject or Challenge. It listens on UDP 1812 for authentication and UDP 1813 for accounting.

Traffic Port Source
Authentication and authorization: Access-Request 1, Access-Accept 2, Access-Reject 3, Access-Challenge 11 UDP 1812 RFC 2865, section 3
Accounting: Accounting-Request 4, Accounting-Response 5 UDP 1813 RFC 2866, section 3
Early deployments of both UDP 1645 and 1646 Port 1645 clashed with another service, so 1812 and 1813 were assigned
RADIUS over TLS (RadSec) TCP 2083 RFC 6614, Experimental, 2012
RADIUS over DTLS UDP 2083 RFC 7360, Experimental, 2014

Where is RADIUS used?

VPN gateways (the NAS here), Wi-Fi access points and switches for 802.1X, and dial-in access, the original job. For 802.1X the device relays EAP in the EAP-Message attribute (79, RFC 3579). SSOGEN supports RADIUS authentication.

How safe is RADIUS over UDP?

Questions people ask

What is a RADIUS login?

A RADIUS login is a sign-in that a gateway or access point passes to a RADIUS server to check. The device builds an Access-Request from what the user types and admits the user only when the server returns an Access-Accept.

Does RADIUS use TCP or UDP?

RADIUS uses UDP by default. Authentication uses UDP 1812 and accounting UDP 1813. RADIUS over TLS, called RadSec, uses TCP 2083 (RFC 6614), and RADIUS over DTLS uses UDP 2083 (RFC 7360). Both RFCs are Experimental.

How does FreeRADIUS work?

FreeRADIUS is an open-source RADIUS server. Devices are added as clients in clients.conf, and users are defined in a users file or a database. Its project site lists enterprise 802.1X and ISP use.

What does RADIUS accounting record?

RADIUS accounting records when a session starts and stops. The gateway sends an Accounting-Request (code 4) to UDP 1813 with Acct-Status-Type Start (1) or Stop (2), and the server answers with code 5 (RFC 2866).

Sources, all read 2026-11-17: RFC 2865, RFC 2866, RFC 2869, RFC 3579, RFC 6614, RFC 7360, Blast-RADIUS disclosure, NVD, CVE-2024-3596, FreeRADIUS, FreeRADIUS wiki, Getting Started.

Updated