Course contents

Chapter 12: Security FundamentalsLesson 11 of 19

AAA: RADIUS and TACACS+

Authentication, authorization and accounting with a central server, and RADIUS vs. TACACS+.

Intermediate · 10 min read

Technical definition

AAA (Authentication, Authorization and Accounting) is a security framework for controlling access to network devices and services: authentication verifies who a user is, authorization decides what that user may do, and accounting records what they did. On Cisco devices it is usually provided by a central RADIUS or TACACS+ server, with the local user database as a fallback.

Forty devices, eight engineers, one missed account

The company now has 40 switches and routers and eight network engineers. With local usernames, every new engineer means logging in to 40 devices to add an account, and when someone leaves, 40 more changes. Last month one device was missed and a former contractor could still log in. The fix is to keep the user list in one central server and have every device ask it. That is what AAA does.

Diagram
SW1 asking a central AAA server to check a login
SW1 asking a central AAA server to check a login
Gi1/0/2Gi1/0/24Gi0/1Gi0/2Admin PCIP 192.168.10.10SW1Vlan10 192.168.10.2R1Gi0/1 .10.1 · Gi0/2 .20.1AAA serverIP 192.168.20.50

Device key: Admin PC (laptop) · SW1 (switch) · R1 (router)

Lines show the example’s network connections. The coloured path and envelope follow the current step; its text identifies the sender, receiver and traffic type.

Reading the addresses

IP labels identify interfaces or destinations. Subnet labels identify networks; /n is the prefix length. A router ID (RID) identifies a routing process and need not be a reachable interface.

An IP address alone is not a URL. A web URL includes a scheme such as https://; an address on a router or printer does not imply a website.

  • Admin PC: IP 192.168.10.10
  • SW1: Vlan10 192.168.10.2
  • R1: Gi0/1 .10.1 · Gi0/2 .20.1
  • AAA server: IP 192.168.20.50
  1. 1. Alice connects to SW1. She types her own username and password, the same ones she uses on every device.
  2. 2. SW1 asks the AAA server. SW1 doesn't hold Alice's account. It sends the credentials to 192.168.20.50 over RADIUS or TACACS+, protected with a shared key.
  3. 3. The server answers. The server checks its user list and replies accept or reject, and can also say what she is allowed to do.
  4. 4. SW1 reports what happened. Accounting records go to the server: when Alice logged in, and later the commands she ran and when she left.

Authentication, authorization, accounting

AAA is a framework with three separate jobs:

Diagram
Authentication, authorization, accounting
Authentication, authorization, accounting
PartQuestion it answersExample
AuthenticationWho are you?Alice logs in with her username and password.
AuthorizationWhat are you allowed to do?Alice gets privilege level 15; a help-desk user may only run show commands.
AccountingWhat did you do?A record says Alice logged in at 09:02, ran shutdown on Gi1/0/5 and logged out at 09:15.
Read each row across: the left box names the item, the others describe it.

The device asking the questions (SW1 here) is often called the network access device or AAA client. The server that answers is the AAA server; Cisco's product for this is Cisco ISE (Identity Services Engine). The two talk with one of two protocols: RADIUS or TACACS+.

RADIUS vs. TACACS+

Diagram
RADIUS vs. TACACS+
RADIUS vs. TACACS+
RADIUSTACACS+
StandardOpen standard (IETF)Created by Cisco, now published as an informational RFC
TransportUDP 1812 (authentication), 1813 (accounting); older 1645/1646TCP 49
EncryptionOnly the password fieldThe whole message body
AAA functionsAuthentication and authorization combined in one replyAll three separate
Command authorizationNo per-command checksYes, each command can be approved and logged
Typical useNetwork access: 802.1X, Wi-Fi, VPN usersDevice administration: engineers logging in to routers and switches
Read each row across: the left box names the item, the others describe it.

Memory aid: RADIUS lets users onto the network, TACACS+ controls admins on the devices.

Why a central server beats local accounts

  • One list, many devices. Adding or removing a person happens once, on the server, and takes effect everywhere.
  • Separate jobs give finer control. Because TACACS+ asks separately for each command, the server can allow show commands for the help desk and everything for senior engineers, and log each command in accounting.
  • A shared key protects the conversation. The device and the server share a secret key. It is used to hide the password (RADIUS) or the whole body (TACACS+) and to prove that replies really come from the server.
  • Method lists avoid lock-out. If the server is down, nobody could log in to fix the network. A method list is an ordered list of ways to authenticate, such as "try the server group, then the local users".

A login, step by step

A method list with local fallback

SW1 uses the login method list selected for the line. In this example it tries the server group before local users. A rejection stops authentication; a method error allows the next method. Those are different branches. A successful identity check still leaves authorization to decide access.

Three outcomes from the TACACS+ authentication methodPASS continues to authorization. FAIL denies the login without local retry. ERROR advances to local, the next method in the illustrated list.TAC-SERVERS authentication resultList: group TAC-SERVERS localPASSFAILERRORIdentity acceptedContinue to authorizationAccess is not proved yetLogin deniedStop; do not try localA rejection is a final resultMethod cannot completeTry next method: localLocal credentials must pass
Figure 2. Alternative results, not three consecutive login steps. A timeout is one possible method error; a server-side error can also advance the list.

A TACACS+ login

Step 1 of 5 · Username and password
TCP 49 to the server · body encrypted with the shared key
Admin PC
SSH client
SW1
TACACS+ client
AAA server
IP 192.168.20.50

Device key: Admin PC (laptop) · SW1 (switch)

Arrows run from each message's sender to its receiver. Rows show message order, not separate cables or elapsed time to scale. Port numbers identify services or conversations, not physical switch sockets.

Reading the addresses

IP labels identify interfaces or destinations. Subnet labels identify networks; /n is the prefix length. A router ID (RID) identifies a routing process and need not be a reachable interface.

An IP address alone is not a URL. A web URL includes a scheme such as https://; an address on a router or printer does not imply a website.

  • Admin PC: SSH client
  • SW1: TACACS+ client
  • AAA server: IP 192.168.20.50

With RADIUS the pattern is shorter: one Access-Request (UDP 1812) and one Access-Accept or Access-Reject that carries both the authentication result and the authorization attributes.

RADIUS and 802.1X: users onto the network

RADIUS is also what makes 802.1X work. 802.1X is port-based access control: a switch port (or Wi-Fi network) lets no traffic through until the device connected to it has logged in. It is a much stronger check than Port security, because it verifies a username or certificate rather than a MAC address that can be copied. There are three roles:

Step 1 of 4 · EAPoL: identity
EAP over LAN, then EAP inside RADIUS
Supplicant
the user's device
Authenticator
SW1 or a WLC
Authentication server
RADIUS (ISE)

Device key: Supplicant (laptop) · Authenticator (switch)

Arrows run from each message's sender to its receiver. Rows show message order, not separate cables or elapsed time to scale. Port numbers identify services or conversations, not physical switch sockets.

The same three roles appear in WPA2/WPA3-Enterprise Wi-Fi, where the wireless controller is the authenticator. See Wireless security.

Configuring AAA on Cisco IOS

Based on Cisco IOS XE documentation, not run on a lab device. Create a local fallback user before typing aaa new-model: from that moment the lines use AAA instead of their line passwords, and the open session is the only safe way back in.

username admin privilege 15 algorithm-type scrypt secret Adm1n-S3cret! aaa new-model

Step 1: a local emergency account, then enable AAA. aaa new-model on its own makes VTY logins check local usernames.

TACACS+ for device administration

tacacs server TAC1 address ipv4 192.168.20.50 key T4cacs-Key! aaa group server tacacs+ TAC-SERVERS server name TAC1

Define the server with its shared key (must match the server exactly), then put it in a named group. A group can hold several servers, tried in order.

aaa authentication login default group TAC-SERVERS local aaa authorization exec default group TAC-SERVERS local aaa authorization commands 15 default group TAC-SERVERS local aaa accounting exec default start-stop group TAC-SERVERS aaa accounting commands 15 default start-stop group TAC-SERVERS

Authenticate logins, authorize the shell and every level-15 command, and record sessions and commands. local after the group is the fallback on a method error, not an explicit rejection.

RADIUS instead

radius server ISE1 address ipv4 192.168.20.50 auth-port 1812 acct-port 1813 key R4dius-Key! aaa group server radius ISE-SERVERS server name ISE1 aaa authentication login VTY-LOGIN group ISE-SERVERS local line vty 0 15 login authentication VTY-LOGIN

A named method list (VTY-LOGIN) applied only to the VTY lines. The console keeps the default behaviour. Older IOS uses the single-line form radius-server host 192.168.20.50 key R4dius-Key!.

Full example for SW1

username admin privilege 15 algorithm-type scrypt secret Adm1n-S3cret! aaa new-model ! tacacs server TAC1 address ipv4 192.168.20.50 key T4cacs-Key! aaa group server tacacs+ TAC-SERVERS server name TAC1 ip tacacs source-interface Vlan10 ! aaa authentication login default group TAC-SERVERS local aaa authorization exec default group TAC-SERVERS local aaa accounting exec default start-stop group TAC-SERVERS ! line console 0 exec-timeout 10 0 line vty 0 15 transport input ssh exec-timeout 10 0 ! end copy running-config startup-config

The default list applies to every line, console included, without a login command on the lines. ip tacacs source-interface makes SW1 always use 192.168.10.2, the address the server has on file for it.

Testing logins before you log out

In practice, AAA changes are made with a second session already open, and a fresh login is tested before either session is closed. If the new method list is wrong, the session that is still open is the way back in.

Example output
SW1#test aaa group TAC-SERVERS alice Al1ce-Pass! legacy
Attempting authentication test to server-group TAC-SERVERS using tacacs+
User was successfully authenticated.
This tests authentication through the named group. Success does not prove SSH line selection, shell or command authorization. A failed test alone does not identify a bad key: match the attempt with the server log and distinguish rejection from an error before changing the key, client registration or account policy.
Example output
SW1#show tacacs
Tacacs+ Server -  public  :
               Server name: TAC1
            Server address: 192.168.20.50
               Server port: 49
              Socket opens:         14
             Socket closes:         14
              Socket aborts:          0
              Socket errors:          0
           Socket Timeouts:          0
   Failed Connect Attempts:          0
        Total Packets Sent:         42
        Total Packets Recv:         42
...
Failed Connect Attempts or Socket Timeouts are clues to investigate the source address, route, TCP 49 path and server response. Packet counters show exchanges, not whether this user was accepted or authorized. Compare counters before and after one identified lab attempt and match its time, user and client address with the server log.
Example output
SW1#show running-config | include aaa
aaa new-model
aaa group server tacacs+ TAC-SERVERS
aaa authentication login default group TAC-SERVERS local
aaa authorization exec default group TAC-SERVERS local
aaa accounting exec default start-stop group TAC-SERVERS
...
A quick check that the method lists are in place and in the right order: the group first, local last.

Find the failed stage before changing access policy

In an isolated IOS XE lab, keep a recovery session available and use the existing named group. Read the effective VTY list and the server result for one test account. If authentication passes but the shell is refused, inspect exec authorization separately. Repair the confirmed account, client or path issue, then test a fresh SSH session and the permitted commands before closing the recovery session. Packet exchange alone is not that verification.

show tacacs show running-config | section line vty

Read-only IOS XE-style inspection. Match the actual VTY method list with the named AAA lists shown above. These commands neither perform a login nor prove that the server granted authorization; output and command support depend on the exact image.

Diagnostic basis: Cisco TACACS authentication troubleshooting. Its PASS, FAIL and ERROR outcomes explain why a failed test needs correlated evidence. These are authored examples, not device execution.

debug aaa authentication shows each step of a login, including which method was tried and its result. Use it carefully on a busy device.

When logins fail: symptoms and fixes

Diagram
When logins fail: symptoms and fixes
When logins fail: symptoms and fixes
SymptomLikely causeFix
A test login failsAccount/policy rejection or a method error; the symptom alone does not isolate the causeCorrelate the server result and client/source details before changing credentials, keys or policy
Server log shows the request from an unknown clientSW1 sends from a different source IP than the server expectsip tacacs source-interface or ip radius source-interface
Locked out after aaa new-modelNo local user and no reachable serverConsole password recovery; next time create the local user first
Server down and the local user can't log inlocal missing from the method listAdd local after the group
The server explicitly rejects a user who also has a local accountThe server-first list stops on rejection, so local is not triedCheck the server account and policy result; do not expect local to override it
Login works but lands at >No exec authorization, so no privilege level from the serveraaa authorization exec default group ... local
Read each row across: the left box names the item, the others describe it.

Mistakes that lock engineers out

  • Typing aaa new-model before any local user exists.
  • Putting local first when server-first policy was intended. A local match is handled locally; this is not the same order as server-group authentication with local fallback. Check the method results on the exact image.
  • Expecting a server reject to fall back to local. A method error can advance the list; a rejection cannot.
  • Mixing up the protocols: RADIUS is UDP and hides only the password; TACACS+ is TCP 49 and encrypts everything.
  • Creating a named method list and forgetting login authentication <name> on the lines, so the default list is used instead.

Exam tip: the CCNA asks you to tell the three As apart from a description ("records the commands a user ran" is accounting) and to compare RADIUS and TACACS+: UDP vs. TCP 49, password-only vs. full-body encryption, combined vs. separate AAA, network access vs. device administration. Know the 802.1X roles: supplicant, authenticator, authentication server. And remember that local fallback follows a method error, not a rejection.

The AAA facts to keep

  • Authentication = who you are; authorization = what you may do; accounting = what you did.
  • A central AAA server means one user list for every device.
  • RADIUS: UDP, open standard, password-only encryption, used for network access and 802.1X.
  • TACACS+: TCP 49, full encryption, separate AAA and per-command control, used for device admin.
  • Method lists such as group TAC-SERVERS local reach local on a server-group method error, not an explicit rejection.

Test yourself on AAA, RADIUS and TACACS+

Predict · scenario 1

A log shows that user bob ran 'reload' on R1 at 14:10. Which part of AAA produced this record?

Predict · scenario 2

Which protocol uses TCP port 49, encrypts the whole message body and separates authentication from authorization?

Predict · scenario 3

The method list is: aaa authentication login default group TAC-SERVERS local. The TACACS+ server is up and rejects alice's password. What happens?

Predict · scenario 4

test aaa succeeds for alice, but her fresh SSH login cannot start a shell. What should you verify next?

Predict · scenario 5

In 802.1X, which role does the access switch play?

Predict · scenario 6

You want each command typed by help-desk staff on routers to be approved or denied by the server. Which protocol fits best?

FAQ

When does a device fall back to its local user database?
When the server-group method returns an error, such as no usable response, and local is the next method. An explicit rejection is different: it ends the attempt without a local retry. A server-side error can also permit the next method; fallback is not limited to a powered-off server.
Why is TACACS+ preferred for logging in to network devices?
TACACS+ handles authentication, authorization and accounting separately, so the server can approve or deny each individual command an admin types and log it. It also encrypts the whole message body over TCP. RADIUS combines authentication and authorization and only hides the password.
Do I need aaa new-model to use a local username?
No. username plus login local on a line works without AAA. aaa new-model is needed when you want method lists, a RADIUS or TACACS+ server, command authorization or accounting.
What is the difference between authentication and authorization?
Authentication proves who you are, for example with a username and password. Authorization decides what you are then allowed to do, such as which privilege level you get or which commands you may run. Accounting records what you did.