Every switch and router in a live lab has these, whatever the lab is about. They behave as in IOS 15, including the prompts and the error markers.
Modes and help
A device starts in user EXEC (R1>). enable goes to privileged EXEC (R1#), configure terminal to global configuration, and from there each interface, line, router or vlan command opens its own mode. exit goes back one level, end or Ctrl+Z back to privileged EXEC.
? lists what can come next; Tab completes a word.
Any unambiguous start of a word works: sh run, conf t, int gi0/0.
do runs an EXEC command from any configuration mode.
Output filters work on every show command: | include, | exclude, | begin and | section, with regular expressions.
Router
In privileged EXEC
show version
The model, the IOS version, the uptime and the interfaces.
show running-config
The configuration in use.
show running-config | section line
Only the line sections (any filter works on any show).
show ip interface brief
Every interface with its address and its status/protocol.
show interfaces
Each interface in detail: status, MAC address, speed and duplex, counters.
show history
The last commands typed on this console.
show clock
The device's time.
Saving, erasing and reloading
Router
In privileged EXEC
copy running-config startup-config
Saves the configuration. Asks for the destination name, as IOS does.
write memory
The older way to save.
show startup-config
The saved configuration, the one a reload loads.
erase startup-config
Deletes the saved configuration (asks to confirm).
reload
Restarts the device with the saved configuration (asks to confirm, and whether to save first).
Names, passwords and banners
Router
In global configuration
hostname R1
Names the device; the prompt follows.
enable secret Cisco123
The privileged EXEC password, stored hashed.
username admin privilege 15 secret Cisco123
A local user, for login local, SSH and AAA.
service password-encryption
Hides the plain-text passwords in the configuration (type 7).
security passwords min-length 8
Refuses shorter passwords from now on.
banner motd #Authorised access only#
The message shown before login.
no ip domain-lookup
Stops a typo from being taken for a host name to look up.
Console and vty lines
Router
Under line console 0
password Cisco123
The console password.
login
Asks for that password.
exec-timeout 5 0
Logs an idle session out after 5 minutes.
Under line vty 0 15
login local
Remote logins use the local usernames.
transport input ssh
Only SSH may log in remotely (telnet, all and none work too).
access-class 10 in
Only the sources standard ACL 10 permits may log in remotely.
Switches have line vty 0 15 too, and the same commands.
SSH
SSH needs a host name, a domain name and an RSA key, as in IOS. Once it is on, a laptop or another device can log in and gets the device's own command line.
Router
In global configuration
ip domain-name ntpath.lab
The domain name the key is named after.
crypto key generate rsa modulus 2048
Creates the key pair and turns the SSH server on.
ip ssh version 2
Only SSH version 2 (needs a key of at least 768 bits).
In privileged EXEC
show ip ssh
Whether SSH is on, and its version.
show ssh
The SSH sessions open now.
ssh -l admin 10.0.0.2
Logs in to another device from this one.
CDP and LLDP
Switch (2960)
In privileged EXEC
show cdp neighbors
The Cisco devices on each port (CDP is on by default).
show cdp neighbors detail
Each neighbour's address, platform and IOS version.
In global configuration
lldp run
Turns LLDP on (it is off by default).
In privileged EXEC
show lldp neighbors
The LLDP neighbours, from any vendor.
Under interface Fa0/1
no cdp enable
Stops CDP on one port, such as one facing a user.
no lldp transmit
Stops sending LLDP on one port (lldp receive is the other half).
In global configuration
no cdp run
Turns CDP off on the whole device.
Port speed and duplex
Switch (2960)
Under interface Gi0/1
description Uplink to R1
A note on the port, shown in show interfaces.
Under interface Fa0/2
speed 100
Fixes the speed instead of autonegotiating. Two ends fixed at different speeds never link (notconnect); an auto end senses a fixed one.
duplex full
Fixes the duplex. An auto end facing a fixed one can't learn its duplex and falls back to half at 10 and 100 Mb/s: a duplex mismatch.
Under interface Fa0/24
no mdix auto
Turns Auto-MDIX off (mdix auto turns it back on, the default). Auto-MDIX makes the wrong cable type work, but only on a port whose speed and duplex are both auto.
shutdown
Disables the port (no shutdown brings it back).
Switch (2960)
In privileged EXEC
show interfaces gi0/1
The negotiated duplex and speed, and the error counters a duplex mismatch drives: late collisions on the half-duplex end, input errors, CRC errors and runts on the full-duplex end.
show interfaces counters errors
Every port's error counters in two tables (show interfaces gi0/1 counters errors for one): FCS-Err, Rcv-Err and Runts grow on the full-duplex end of a mismatch, Late-Col on the half-duplex end.
clear counters
Zeroes the counters of every interface after a [confirm] (clear counters gi0/1 for one), and logs %CLEAR-5-COUNTERS. Clear them after a fix, then test again.
A link may name its cable (straight-through or crossover). Like ports (switch to switch, router to router or PC) need a crossover, unlike ports a straight-through. CDP logs %CDP-4-DUPLEX_MISMATCH on both ends while a mismatch lasts.