Local accounts first, then AAA logins through a TACACS+ server with a local fallback

short · 40 min · Packet Tracer · Exam topic 4.1

Task

Give R1 two local accounts at different privilege levels and make SSH and the console use them. Then turn on AAA so that SSH logins are checked by a TACACS+ server on SRV1, with the local accounts as the fallback, while the console keeps a local-only method list of its own. You finish able to show which privilege level each account lands at, prove that the fallback works when the server is unreachable, and read back the method lists that decide it.

Topology

Devices

Device Model Role
R1 ISR4331 router being managed
S1 2960-24TT access switch, no configuration needed
PC1 PC-PT administrator's PC, used as the SSH client
SRV1 Server-PT AAA server running TACACS+

Links

From To
R1 G0/0/0 S1 G0/1
PC1 Fa0 S1 Fa0/1
SRV1 Fa0 S1 Fa0/2

Addressing

Device Interface Address Default gateway
R1 G0/0/0 192.168.17.1/24 none
PC1 NIC 192.168.17.10/24 192.168.17.1
SRV1 NIC 192.168.17.50/24 192.168.17.1

Steps

  1. Place the four devices and cable them as the Topology lists. Use the automatic connection type (the lightning-bolt cable) for every link, so Packet Tracer picks straight-through or cross-over for you. Give PC1 and SRV1 their addresses and gateway in Desktop > IP Configuration. Then name and address R1 from its CLI tab:
Router> enable
Router# configure terminal
Router(config)# hostname R1
R1(config)# interface GigabitEthernet0/0/0
R1(config-if)# ip address 192.168.17.1 255.255.255.0
R1(config-if)# no shutdown
R1(config-if)# exit

From PC1's Command Prompt, C:\> ping 192.168.17.1 should get replies before you go on. 2. Give R1 what SSH needs. Lesson 18 explains these lines; here they only give the VTY lines an SSH login to accept. Packet Tracer accepts the older spelling ip domain-name, which the lesson writes as ip domain name:

R1(config)# ip domain-name example.com
R1(config)# crypto key generate rsa general-keys modulus 1024
R1(config)# ip ssh version 2
  1. Create two local accounts and an enable secret. These are lab-only passwords. netops gets privilege 15; helpdesk gets the default level 1:
R1(config)# username netops privilege 15 secret lab-only-ops
R1(config)# username helpdesk secret lab-only-desk
R1(config)# enable secret lab-only-enable
R1(config)# do show running-config | include username

Each username line shows secret followed by a type number and a hash, never the password itself. That is the one-way hash the lesson describes. 4. A username changes nothing until the lines are told to use the local database. Point the VTY lines and the console at it, refuse Telnet, and log idle sessions out after ten minutes:

R1(config)# line vty 0 4
R1(config-line)# login local
R1(config-line)# transport input ssh
R1(config-line)# exec-timeout 10 0
R1(config-line)# exit
R1(config)# line console 0
R1(config-line)# login local
R1(config-line)# end
  1. Test both accounts from PC1's Command Prompt. Log in as helpdesk with lab-only-desk, check the level, leave, then do the same as netops with lab-only-ops:
C:\> ssh -l helpdesk 192.168.17.1
Password:
R1> show privilege
Current privilege level is 1
R1> exit
C:\> ssh -l netops 192.168.17.1
Password:
R1# show privilege
Current privilege level is 15
R1# exit

netops lands straight at R1# without typing enable, because the privilege level on the username decides where a login starts. 6. Build the AAA server. On SRV1 open Services > AAA and set Service to On. Under Network Configuration enter Client Name R1, Client IP 192.168.17.1, Secret lab-only-tackey and ServerType Tacacs, then click Add. Under User Setup add Username aaaadmin with Password lab-only-aaa, then click Add. Note that netops and helpdesk exist only on R1, not on the server. The Secret is the shared key; it must match the key that R1 sends, and both are lab-only values. 7. Point R1 at the server and switch AAA on. A local privilege-15 account already exists, which is exactly the lesson's rule: create a local user before you type aaa new-model. The default list sends logins to TACACS+ first and to the local accounts only if the server gives no answer; the CON list keeps the console local:

R1# configure terminal
R1(config)# tacacs-server host 192.168.17.50
R1(config)# tacacs-server key lab-only-tackey
R1(config)# aaa new-model
R1(config)# aaa authentication login default group tacacs+ local
R1(config)# aaa authentication login CON local
R1(config)# line vty 0 4
R1(config-line)# login authentication default
R1(config-line)# exit
R1(config)# line console 0
R1(config-line)# login authentication CON
R1(config-line)# end

The lesson defines the server with the named form (tacacs server TAC1, then address ipv4 and key). This lab uses the older single-line tacacs-server commands, which do the same job and which Packet Tracer accepts. 8. From PC1, log in as the server's user. The login succeeds through TACACS+, yet it lands at user EXEC, because nothing asks the server for a privilege level (that is exec authorisation, which this lab leaves off):

C:\> ssh -l aaaadmin 192.168.17.1
Password:
R1> show privilege
Current privilege level is 1
R1> exit
  1. Break it: on SRV1, set the AAA Service to Off. From PC1, try ssh -l aaaadmin 192.168.17.1 again: it fails, because the server is silent and R1 has no local account called aaaadmin. Now try ssh -l netops 192.168.17.1 with lab-only-ops: after a pause while R1 waits for the server, you land at R1#. No answer from the server is an error, so R1 moved on to the next method, local. Without local at the end of the default list, every SSH login would now be locked out. Fix it by setting SRV1's AAA Service back to On, and log in as aaaadmin once more to confirm.

Verify

R1# show running-config | include aaa

Expected output: the lines aaa new-model, aaa authentication login default group tacacs+ local and aaa authentication login CON local.

Open an SSH session from PC1 as aaaadmin and leave it open. In that session run:

R1> show privilege

Expected output: Current privilege level is 1. Then, on R1's console (log in as netops, because the console uses the CON list):

R1# show users

Expected output: a line for the console, con 0, marked with an asterisk as your own session, and a vty line for the SSH session from 192.168.17.10.

Save your work

On R1 run R1# copy running-config startup-config, then save the topology as ccna-lab17-aaa.pkt (File > Save As).

Notes

A reject is not an error. If the server is reachable and refuses a login, R1 denies it and does not try the local password, so with the default list above netops can log in only while the server is silent. To try RADIUS instead, change the client's ServerType on SRV1 to Radius, and on R1 use radius-server host 192.168.17.50, radius-server key and group radius in the list. The AAA service page on SRV1 also shows the port it listens on for RADIUS: compare it with the UDP 1812 the IETF assigned and the older 1645 the lesson mentions.

This is an independent study companion for the Cisco CCNA 200-301 v2.0 exam and is not produced by or endorsed by Cisco. Cisco, CCNA and IOS are trademarks of Cisco Systems, Inc.

This is an independent study companion for Cisco CCNA 200-301 and is not produced by or endorsed by CompTIA.