AAA: authentication, authorization and accounting
| Question | In this lab | |
|---|---|---|
| Authentication | Who are you? | Ana's user and password, checked by ISE |
| Authorization | What can you do? | Privilege level 15, sent in the Access-Accept |
| Accounting | What did you do and when? | The session Start and Stop, with its duration |
The router acts as an AAA client (called a NAS in RADIUS) and the central server decides. Removing an administrator is done once, on the server, not on every device.
RADIUS messages
| Code | Message | Port | Purpose |
|---|---|---|---|
| 1 | Access-Request | 1812 | The NAS asks to authenticate a user |
| 2 | Access-Accept | 1812 | Access allowed, with authorization attributes |
| 3 | Access-Reject | 1812 | Access denied |
| 11 | Access-Challenge | 1812 | The server asks for more (for example a second factor or EAP) |
| 4 | Accounting-Request | 1813 | Record of a session start, update or end |
| 5 | Accounting-Response | 1813 | Confirms the record |
Cisco IOS sends from ports 1645 and 1646, the numbers RADIUS used before IANA assigned 1812 and 1813.
How it works: from the failed attempt to the session record
Four steps: a rejected Access-Request, an accepted one with its authorization, the accounting Start and the Stop on exit.
Wrong password: Access-Reject
Ana runs ssh ana@192.168.10.1 and mistypes her password. Since the authentication method is “group radius local”, R1 does not check its local database: it sends an Access-Request to ISE over UDP 1812 with the user, the hidden password, the vty line and Ana's IP. ISE checks it and answers Access-Reject, signed with the shared secret. R1 denies access. The local database is only used if the server does not answer, not when it rejects.
Right password: Access-Accept
On the second try, R1 sends another Access-Request with a new identifier and authenticator. ISE answers Access-Accept: in RADIUS, authentication and authorization travel together. The Accept carries a Cisco attribute (VSA 26) with “shell:priv-lvl=15”, so Ana lands straight in privileged mode (R1#), and a Class attribute R1 will return in accounting.
Accounting: Start
With “aaa accounting exec default start-stop group radius”, R1 sends an Accounting-Request with Acct-Status-Type = Start to UDP 1813: the user, the session ID, the line, Ana's IP and the Class it received. The authenticator is now an MD5 of the message itself with the secret, because there is no password to hide. ISE stores the record and confirms with an Accounting-Response.
Accounting: Stop on exit
Ana works for 14 minutes and types exit. R1 sends the Stop Accounting-Request with the same session ID, the duration (842 s) and the cause (User Request). ISE confirms it. With Start and Stop, the security team knows who managed R1, from which IP and for how long: the “A” for Accounting in AAA.
RADIUS vs TACACS+
| RADIUS | TACACS+ | |
|---|---|---|
| Transport | UDP 1812/1813 | TCP 49 |
| What it encrypts | Only the password | The whole message body |
| Authentication and authorization | Together, in the Access-Accept | Separate |
| Per-command authorization | No | Yes |
| Standard | IETF (RFC 2865) | Created by Cisco, documented in RFC 8907 |
| Typical use | Network access: 802.1X, Wi-Fi, VPN | Device administration |
AAA with RADIUS on Cisco IOS XE
| Command | What it does |
|---|---|
aaa new-model | Enables AAA: from here on, lines use method lists. |
radius server ISE · address ipv4 192.168.20.50 auth-port 1812 acct-port 1813 | Defines the server and its ports. |
key … | The shared secret: it must match on the server. |
aaa authentication login default group radius local | Asks RADIUS; if it does not answer, uses local users. |
aaa authorization exec default group radius local if-authenticated | Applies the privilege level the server sends. |
aaa accounting exec default start-stop group radius | Records the start and end of every session. |
ip radius source-interface GigabitEthernet0/0/2 | The IP R1 presents to the server. |
username admin privilege 15 secret … | Local backup user. |
test aaa group radius ana … new-code | Tests an authentication without logging in. |
debug radius authentication | Shows every Access-Request and its answer. |
CCNA v2.0 topic 4.1 asks you to configure devices with local usernames and as an AAA client (TACACS+ and RADIUS) for management.
Security: the secret and Blast-RADIUS
RADIUS relies on MD5 and the shared secret: with a short secret, anyone who captures the traffic can guess it and recover the passwords. In 2024, the Blast-RADIUS attack (CVE-2024-3596) showed that an Access-Accept can be forged from a Reject. The defenses: a long random secret, requiring the Message-Authenticator attribute in every message, and carrying RADIUS inside TLS (RadSec) when it crosses networks you do not control.
Frequently asked questions
Does RADIUS encrypt the whole message?
No: it only hides the password. The user, the IPs and the other attributes travel in clear text. TACACS+ does encrypt the whole body.
When does R1 use local users?
Only if the server does not answer (error or timeout). If the server answers Access-Reject, R1 denies access without trying the local database.
What is the shared secret?
A key known to the NAS and the server. It hides the password and signs each reply; if it does not match, the server drops the requests.
Why 1645 and not 1812?
Those are RADIUS's original ports; Cisco IOS still uses them as the source. The server listens on whatever is configured, here 1812 and 1813.
How does R1 know which privilege to give?
From the Cisco attribute shell:priv-lvl=15 in the Access-Accept, applied with aaa authorization exec.
What you take away
- AAA separates authentication, authorization and accounting, and centralizes them on a server.
- RADIUS runs over UDP 1812 (access) and 1813 (accounting); Cisco sends from 1645/1646.
- Only the password travels hidden, with MD5 and the shared secret.
- In RADIUS, authorization arrives in the Access-Accept, for example shell:priv-lvl=15.
- The local database is a backup for when the server does not answer, not for when it rejects.
- Accounting records every session with Start and Stop.
NEXT STEP
From this lesson to the Canadá Logística network
In the CCNA 2.0 Course you configure local users and AAA with RADIUS and TACACS+ on Canadá Logística's routers and switches, with local backup and accounting, in Packet Tracer or CML. We'll let you know when it opens.
Upcoming protocol lessons
Sources
- RFC 2865 · Remote Authentication Dial In User Service (RADIUS)
- RFC 2866 · RADIUS Accounting
- Cisco · Configuring Authentication (AAA)
- Cisco · Configure Basic AAA on an Access Server (doc. 10384)
- Cisco · 200-301 CCNA v2.0 Exam Topics (4.1)
Lesson prepared with AI assistance and checked against the sources cited. The bytes of every packet are generated according to the standard and verified with an independent tool.