7.2.6 Packet Tracer - Configure Local AAA for Console and VTY Access Answers

Packet Tracer Packet Tracer Labs Original source

7.2.6 Packet Tracer - Configure Local AAA for Console and VTY Access Answers Version

Topology

7.2.6 Packet Tracer – Configure Local AAA for Console and VTY Access

7.2.6 Packet Tracer – Configure Local AAA for Console and VTY Access

Addressing Table

Device Interface IP Address Subnet Mask Default Gateway Switch Port
R1 G0/1 192.168.1.1 255.255.255.0 N/A S1 F0/1
S0/0/0 (DCE) 10.1.1.2 255.255.255.252 N/A N/A
R2 G0/0 192.168.2.1 255.255.255.0 N/A S2 F0/2
S0/0/0 10.1.1.1 255.255.255.252 N/A N/A
S0/0/1 (DCE) 10.2.2.1 255.255.255.252 N/A N/A
R3 G0/1 192.168.3.1 255.255.255.0 N/A S3 F0/5
S0/0/1 10.2.2.2 255.255.255.252 N/A N/A
PC-A NIC 192.168.1.3 255.255.255.0 192.168.1.1 S1 F0/2
PC-B NIC 192.168.2.3 255.255.255.0 192.168.2.1 S2 F0/1
PC-C NIC 192.168.3.3 255.255.255.0 192.168.3.1 S3 F0/18

Objectives

Background / Scenario

The network topology shows routers R1, R2 and R3. Currently, all administrative security is based on knowledge of the enable secret password. Your task is to configure and test local and server-based AAA solutions.

You will create a local user account and configure local AAA on router R1 to test the console and vty logins.

The routers have also been pre-configured with the following:

Note: The console and vty lines have not been pre-configured.

Note: Newer IOS images use more secure encryption hashing algorithm; however, the IOS version currently supported in Packet Tracer uses MD5. Always use the most secure option available on your physical equipment.

Part 1: Configure Local AAA Authentication for Console Access on R1

Step 1: Configure a local username on R1.

Configure a username of Admin1 with a secret password of admin1pa55.

Copy

R1(config)# username Admin1 secret admin1pa55
Step 2: Configure local AAA authentication for console access on R1.

Enable AAA on R1 and configure AAA authentication for the console login to use the local database.

Copy

R1(config)# aaa new-model



R1(config)# aaa authentication login default local
Step 3: Configure the line console to use the defined AAA authentication method.

Enable AAA on R1 and configure AAA authentication for the console login to use the default method list.

Copy

R1(config)# line console 0



R1(config-line)# login authentication default
Step 4: Verify the AAA authentication method.

Verify the user EXEC login using the local database.

Copy

R1(config-line)# end



%SYS-5-CONFIG_I: Configured from console by console



R1# exit



R1 con0 is now available



Press RETURN to get started.



************ AUTHORIZED ACCESS ONLY *************



UNAUTHORIZED ACCESS TO THIS DEVICE IS PROHIBITED.



User Access Verification



Username: Admin1



Password: admin1pa55



R1>

Part 2: Configure Local AAA Authentication for vty Lines on R1

Step 1: Configure domain name and crypto key for use with SSH.

a. Use netsec.com as the domain name on R1.

Copy

R1(config)# ip domain-name netsec.com

b. Create an RSA crypto key using 1024 bits.

Copy

R1(config)# crypto key generate rsa general-keys modulus 1024



The name for the keys will be: R1.netsec.com



% The key modulus size is 1024 bits



% Generating 1024 bit RSA keys, keys will be non-exportable…[OK]



*Mar 1 0:2:12.822: %SSH-5-ENABLED: SSH 1.99 has been enabled
Step 2: Configure a named list AAA authentication method for the vty lines on R1.

Configure a named list called SSH-LOGIN to authenticate logins using local AAA.

Copy

R1(config)# aaa authentication login SSH-LOGIN local
Step 3: Configure the vty lines to use the defined AAA authentication method.

Configure the vty lines to use the named AAA method and only allow SSH for remote access.

Copy

R1(config)# line vty 0 4



R1(config-line)# login authentication SSH-LOGIN



R1(config-line)# transport input ssh



R1(config-line)# end
Step 4: Verify the AAA authentication method.

Verify the SSH configuration SSH to R1 from the command prompt of PC-A.

Copy

PC> ssh –l Admin1 192.168.1.1

Open

Password: admin1pa55

Device Configs - Final

Router R1

Copy

! ==============================================================

!--- 7.2.6 Packet Tracer - Configure Local AAA for Console and VTY Access

!--- ANSWER SCRIPT FOR ROUTER R1

!--- Usage: copy this whole file and paste it into the R1 terminal (start at the R1> prompt). Every line beginning with "!" is a comment; IOS ignores it, so pasting a comment by accident is harmless.

! ==============================================================



enable

configure terminal



! --------------------------------------------------------------

!--- Part 1: Configure Local AAA Authentication for Console Access.

! --------------------------------------------------------------



!--- Configure a local username with a strong encrypted secret, for the local AAA database to authenticate against.

username Admin1 secret admin1pa55



!--- Enable AAA on R1.

aaa new-model



!--- Configure the default AAA login method list to use the local database.

aaa authentication login default local



!--- Apply the default AAA method list to the console line.

line console 0

 login authentication default

 exit



! --------------------------------------------------------------

!--- Part 2: Configure Local AAA Authentication for VTY Lines (SSH).

! --------------------------------------------------------------



!--- Set the domain name; required before RSA keys can be generated.

ip domain-name netsec.com



!--- Generate 1024-bit RSA keys for SSH (hostname/domain-name are already set above, so the key name R1.netsec.com resolves correctly).

crypto key generate rsa general-keys modulus 1024



!--- Configure a named AAA method list, SSH-LOGIN, to authenticate against the local database.

aaa authentication login SSH-LOGIN local



!--- Apply the SSH-LOGIN method list to the VTY lines and restrict remote access to SSH only.

line vty 0 4

 login authentication SSH-LOGIN

 transport input ssh

 exit



end



! --------------------------------------------------------------

!--- Save the configuration to NVRAM. (Press Enter when prompted for the destination filename.)

! --------------------------------------------------------------

copy running-config startup-config





! ==============================================================

!--- Verification:

!---   show run | section line con      -> confirms "login authentication default" under line console 0

!---   show run | section line vty      -> confirms "login authentication SSH-LOGIN" and "transport input ssh"

!---   show crypto key mypubkey rsa     -> confirms a 1024-bit RSA key pair named R1.netsec.com exists

!---   (console) exit then reconnect    -> confirms the console now prompts "Username:" / "Password:" using Admin1 / admin1pa55

!---   ssh -l Admin1 192.168.1.1 (from PC-A) -> confirms SSH login works end-to-end using the same local AAA database

!--- Note: R2 and R3 are pre-configured for this activity (enable secret ciscoenpa55, OSPF MD5 auth) —

!--- only R1 needs AAA configured. Both console and VTY now authenticate through the local user database,

!--- so losing the Admin1 credentials would lock out console access too; keep the enable secret as a fallback.

! ==============================================================

Download Packet Tracer (.pka) file:

Icon

7.2.6 Packet Tracer - Configure Local AAA for Console and VTY Access .PKA 390.76 KB 2827 downloads

...

Download

← All Packet Tracer articles Home