Concepts / Network access control

Network access control

AAA for device logins (RADIUS and TACACS+)

Also called AAA, TACACS+, aaa new-model, privilege level, accounting, break-glass account, local fallback, Cisco-AVPair

Routers and switches asking a central server who may log in, at what privilege, and recording each session.

The device asks a server who may log in
The device asks a server who may log in

The router keeps no accounts: one server answers who this is and at what privilege, and receives a record of each session. Local accounts are used only when no server answers, never after a reject.

AAA is routers and switches asking a central server who may log in (authentication), at what privilege (authorization), and reporting each session (accounting). On IOS, aaa authentication login default group radius local asks the servers first and uses local accounts only when no server answers, never after a reject. RADIUS (UDP 1812/1813) hides only the password; TACACS+ (TCP 49) encrypts the whole body and can authorize and log every command.

How AAA with RADIUS works, step by step

In the AAA with RADIUS lab depotRouter (10.30.1.2) is the NAS, aaaServer (10.30.1.10) runs FreeRADIUS, and people log in from opsLaptop (10.30.1.20). The router and the server share a secret. RADIUS is RFC 2865 (authentication, UDP 1812) and RFC 2866 (accounting, UDP 1813).

  1. Access-Request. rosa opens SSH to the router. sshd hands the login to PAM, whose first auth line sends code 1 with User-Name, User-Password, NAS-IP-Address and NAS-Port. The password attribute is XORed with an MD5 stream of the secret and the request's 16-byte Authenticator; every other attribute travels in clear. A Message-Authenticator (an HMAC-MD5 over the packet, RFC 3579) signs it, and this server refuses a request without one.
  2. Access-Accept (code 2) or Access-Reject (code 3). The accept carries the authorization: rosa gets Service-Type = Administrative-User, idris and theo NAS-Prompt-User. The router enforces it for the whole session; here the login script puts an Administrative-User in the group frrvty, which may run vtysh.
  3. Accounting-Request Start (code 4). When the session opens, PAM's session line reports it to port 1813 with an Acct-Session-Id; the server answers Accounting-Response (code 5).
  4. Accounting-Request Stop. When it closes, the same session ID with Acct-Session-Time.

The method list decides what happens when the server is silent. On a router CLI it reads like aaa authentication login default group radius local; on this Linux router the PAM file plays that part. Local accounts are tried only after no answer (an error), never after an Access-Reject (a failure).

What it looks like on a Linux machine

The router's PAM file is the method list:

$ grep -v '^#' /etc/pam.d/sshd

auth      sufficient pam_exec.so quiet expose_authtok /usr/local/sbin/radius-login
auth      requisite  pam_exec.so quiet /usr/local/sbin/radius-silent
auth      required   pam_unix.so
account   include    base-account
session   optional   pam_exec.so quiet /usr/local/sbin/radius-accounting
session   include    base-session

tcpdump -v on aaaServer decodes rosa's login. The name is readable, the password is not, and the accept carries her role:

10.30.1.2.37024 > 10.30.1.10.1812: RADIUS, length: 74
	Access-Request (1), id: 0xe0, Authenticator: 1442e2b854bb31ad29f796bd8508d9fb
	  Message-Authenticator Attribute (80), length: 18, Value: ...5.....X/.~...
	  User-Name Attribute (1), length: 6, Value: rosa
	  User-Password Attribute (2), length: 18, Value:
	  NAS-IP-Address Attribute (4), length: 6, Value: 10.30.1.2
	  NAS-Port Attribute (5), length: 6, Value: 0
10.30.1.10.1812 > 10.30.1.2.37024: RADIUS, length: 44
	Access-Accept (2), id: 0xe0, Authenticator: f8b77e8e1e609b68ece9f324d2bc1912
	  Message-Authenticator Attribute (80), length: 18, Value: 8..$g.6.Om!.
	  Service-Type Attribute (6), length: 6, Value: Administrative

FreeRADIUS logs each answer (auth = yes):

$ grep Login /var/log/radius/radius.log
Mon Nov  2 09:41:23 2026 : Auth: (0) Login OK: [rosa] (from client depotRouter port 0)
Mon Nov  2 09:41:24 2026 : Auth: (1) Login incorrect (pap: Cleartext password does not match "known good" password): [rosa] (from client depotRouter port 0)

The Stop record lands in the accounting detail file:

Mon Nov  2 09:41:34 2026
	User-Name = "rosa"
	Acct-Status-Type = Stop
	Acct-Session-Id = "depotRouter-610"
	NAS-Identifier = "depotRouter"
	Calling-Station-Id = "10.30.1.20"
	Acct-Session-Time = 4

What goes wrong, and how you see it

Shared secret mismatch. The server drops the request without a reply, so it looks like an outage, and the local account suddenly works. FreeRADIUS logs Received packet from 10.30.1.2 with invalid Message-Authenticator! (Shared secret is incorrect.). Make clients.conf and the router agree.

Unknown client. A request from an address not in clients.conf is ignored too, with Ignoring request ... from unknown client in the log. Add the device by address.

Everyone gets full rights. A help-desk user can change things. Capture the Access-Accept: it says Service-Type = Administrative-User. Fix the user's entry on the server, not the device.

Local fallback that never fires. A method list that ends the login on any RADIUS failure locks everyone out during an outage. The log shows no answer with no local attempt. Fall through only on silence.

Local fallback that always fires. The opposite mistake: trying local accounts after a reject makes the break-glass account a permanent back door outside the server's logs.

Questions people ask

RADIUS vs TACACS+? RADIUS (UDP 1812/1813, open standard) hides only the password and authorizes once at login. TACACS+ (TCP 49, RFC 8907) encrypts the whole body, separates the three A's and can authorize and log each command, so it is the usual choice for device administration; RADIUS for network access such as 802.1X.

What is the difference between authentication and authorization? Who you are, and what you may do. See authentication vs authorization; RADIUS carries both in one Access-Accept.

Why keep a local account? For when the server is unreachable. Keep it rare, long, sealed, and changed after use.

See it on real machines

Read next

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Sign in with Google or email to start.

Start this lab