A simulated CLI for this lab — click R1, a PC, or SW2, type the commands, and watch logins succeed or fail for real reasons. Telnet and SSH from the PCs run through the actual VTY checks: transport, ACL, and credentials. This models Lab 12’s commands only, not real devices: unsupported commands say so instead of faking it. Type ? for help and use Tab to complete a command.
Microsoft Windows [Version 10.0.19045.0]
(c) Microsoft Corporation. All rights reserved.
Up/down arrows recall commands. The full command list is in the walkthrough below.
Interactive lab
Lab 12 — Device Security
One router, two workstations, and a switch to manage. Lock the box down the way the pack does: a secret that beats the password, local users with AAA, SSH only — then prove each control from the PCs.
Click a device to open its console, type the real commands, and check your work when you think it’s done. The lab checks each step as you go.
Walkthrough — commands in order
One router, two workstations, and a switch to manage. Lock the box down the way the pack does: a secret that beats the password, local users with AAA, SSH only — then prove each control from the PCs, including the ones that should fail.
PC1 10.0.0.10 (admin) ──┐
PC2 10.0.0.20 (untrusted) ─┤ 10.0.0.0/24 ── R1 G0/0 10.0.0.1
└─ R1 G0/1 10.0.1.1 ── 10.0.1.0/24 ── SW2 (Vlan1 10.0.1.50) · NTP 10.0.1.100
The pack uses Fa0/0/Fa0/1; the simulator uses G0/0/G0/1.Where this shows up in the data center
I don’t harden routers in production — the network team owns that — but I live with the results every shift: a locked-out console during an outage, a management interface that answers Telnet when it shouldn’t, an SSH login that works from the wrong workstation. The checks are the same ones as this lab — is the secret actually the one that unlocks enable, does the VTY ACL admit only the admin host, is Telnet really off — and the same prove-it-first discipline as checking LLDP neighbors and optical levels before touching a fiber link.
R1(config)# enable password Flackbox2 R1(config)# enable secret Flackbox1 R1(config)# service password-encryption
Try enable with Flackbox2 after this step — it’s denied. Flackbox1 works. The secret always wins.
R1(config)# access-list 1 permit host 10.0.0.10 R1(config)# line console 0 R1(config-line)# exec-timeout 15 R1(config)# line vty 0 15 R1(config-line)# exec-timeout 15 R1(config-line)# login R1(config-line)# password Flackbox3 R1(config-line)# access-class 1 in R1(config)# banner login "Authorised users only"
login before password prints "% Login disabled on line 0, until 'password' is set" — real IOS warns you, then accepts the command once the password is set.
R1(config)# username admin secret Flackbox4 R1(config)# line vty 0 15 R1(config-line)# login local R1(config)# aaa new-model R1(config)# aaa authentication login default local
The VTY password Flackbox3 is still in the config, but login local now takes precedence for VTY logins.
R1(config)# ip domain-name flackbox.com R1(config)# crypto key generate rsa modulus 768 R1(config)# ip ssh version 2 R1(config)# line vty 0 15 R1(config-line)# transport input ssh
The key generation prints the key name (R1.flackbox.com) and a one-line [OK]. Real IOS asks interactively for the modulus and shows a longer generation transcript; this lab uses the one-line form.
C:\> telnet 10.0.0.1 C:\> ssh -l admin 10.0.0.1 Username: admin Password: Flackbox4 C:\> telnet 10.0.0.1 C:\> ssh -l admin 10.0.0.1
Run the first two on PC1 and the last two on PC2. A wrong password gives "% Access denied" and closes the connection — try it.
R1(config)# line console 0 R1(config-line)# login R1(config-line)# password Flackbox5
Close the R1 console (exit twice) and reopen it — the Password: prompt appears, and Flackbox5 gets you in. (Console login local is not modeled on reconnect; the pack uses a plain console password.)
R1(config)# clock timezone PST -8 R1(config)# ntp server 10.0.1.100 SW2(config)# interface vlan 1 SW2(config-if)# ip address 10.0.1.50 255.255.255.0 SW2(config-if)# no shutdown SW2(config)# ip default-gateway 10.0.1.1
show ntp status on R1 should say synchronized, stratum 2. The NTP server is on a connected network, which is what makes sync possible.
Verify it worked
Don’t trust the config until a show command proves it. These are the outputs you should see — if yours differ, that’s the troubleshooting.
R1# show running-config (step 2)
Building configuration... Current configuration : 1234 bytes ! version 15.0 service timestamps debug datetime msec service timestamps log datetime msec service password-encryption ! hostname R1 ! ip domain-lookup enable secret 5 $1$mERr$hx5rVt7rPNoS4wqbXKX7m0 enable password 7 0807404F0A1207180A59 banner login ^C Authorised users only ^C ! interface GigabitEthernet0/0 ip address 10.0.0.1 255.255.255.0 no shutdown ! interface GigabitEthernet0/1 ip address 10.0.1.1 255.255.255.0 no shutdown ! access-list 1 permit host 10.0.0.10 ! line con 0 exec-timeout 15 0 line vty 0 15 exec-timeout 15 0 password 7 0822455D0A16 login access-class 1 in ! end
R1# show running-config (step 4)
Building configuration... Current configuration : 1234 bytes ! version 15.0 service timestamps debug datetime msec service timestamps log datetime msec service password-encryption ! hostname R1 ! ip domain-lookup ip domain-name flackbox.com enable secret 5 $1$mERr$hx5rVt7rPNoS4wqbXKX7m0 enable password 7 0807404F0A1207180A59 aaa new-model aaa authentication login default local username admin secret 5 $1$mERr$hx5rVt7rPNoS4wqbXKX7m0 ip ssh version 2 banner login ^C Authorised users only ^C ! interface GigabitEthernet0/0 ip address 10.0.0.1 255.255.255.0 no shutdown ! interface GigabitEthernet0/1 ip address 10.0.1.1 255.255.255.0 no shutdown ! access-list 1 permit host 10.0.0.10 ! line con 0 exec-timeout 15 0 line vty 0 15 exec-timeout 15 0 password 7 0822455D0A16 login local transport input ssh access-class 1 in ! end
R1# show ip ssh (step 4)
SSH Enabled - version 2.0 Authentication methods:publickey,keyboard-interactive,password Authentication Publickey Algorithms:ssh-rsa Host key algorithms:ssh-rsa Encryption Algorithms:aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc,aes192-cbc,aes256-cbc MAC Algorithms:hmac-sha1,hmac-sha1-96 Authentication timeout: 120 secs; Authentication retries: 3 Minimum expected Diffie Hellman Module size : 1024
R1# show users (after PC1 SSH login)
Line User Host(s) Idle Location 0 con 0 idle 00:00:00 Interface User Mode Idle Peer Address 1 vty 0 admin ssh 00:00:00 10.0.0.10
PC1: telnet 10.0.0.1 (step 5)
Trying 10.0.0.1... Open [Connection to 10.0.0.1 closed by remote host]
Check yourself
Three questions from the exam angle. Tap to reveal the answer — say it out loud first.
Q1. Both an enable password and an enable secret are set. Which one unlocks enable, and why?
Q2. PC2 can ping R1, but telnet and SSH from PC2 are both refused. What’s blocking it?
Q3. SSH from PC1 fails with "Connection refused" even though the VTY lines are configured. What’s missing?