Device basics and management access

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.

Router
In privileged EXEC
show versionThe model, the IOS version, the uptime and the interfaces.
show running-configThe configuration in use.
show running-config | section lineOnly the line sections (any filter works on any show).
show ip interface briefEvery interface with its address and its status/protocol.
show interfacesEach interface in detail: status, MAC address, speed and duplex, counters.
show historyThe last commands typed on this console.
show clockThe device's time.

Saving, erasing and reloading

Router
In privileged EXEC
copy running-config startup-configSaves the configuration. Asks for the destination name, as IOS does.
write memoryThe older way to save.
show startup-configThe saved configuration, the one a reload loads.
erase startup-configDeletes the saved configuration (asks to confirm).
reloadRestarts the device with the saved configuration (asks to confirm, and whether to save first).

Names, passwords and banners

Router
In global configuration
hostname R1Names the device; the prompt follows.
enable secret Cisco123The privileged EXEC password, stored hashed.
username admin privilege 15 secret Cisco123A local user, for login local, SSH and AAA.
service password-encryptionHides the plain-text passwords in the configuration (type 7).
security passwords min-length 8Refuses shorter passwords from now on.
banner motd #Authorised access only#The message shown before login.
no ip domain-lookupStops a typo from being taken for a host name to look up.

Console and vty lines

Router
Under line console 0
password Cisco123The console password.
loginAsks for that password.
exec-timeout 5 0Logs an idle session out after 5 minutes.
Under line vty 0 15
login localRemote logins use the local usernames.
transport input sshOnly SSH may log in remotely (telnet, all and none work too).
access-class 10 inOnly 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.labThe domain name the key is named after.
crypto key generate rsa modulus 2048Creates the key pair and turns the SSH server on.
ip ssh version 2Only SSH version 2 (needs a key of at least 768 bits).
In privileged EXEC
show ip sshWhether SSH is on, and its version.
show sshThe SSH sessions open now.
ssh -l admin 10.0.0.2Logs in to another device from this one.

CDP and LLDP

Switch (2960)
In privileged EXEC
show cdp neighborsThe Cisco devices on each port (CDP is on by default).
show cdp neighbors detailEach neighbour's address, platform and IOS version.
In global configuration
lldp runTurns LLDP on (it is off by default).
In privileged EXEC
show lldp neighborsThe LLDP neighbours, from any vendor.
Under interface Fa0/1
no cdp enableStops CDP on one port, such as one facing a user.
no lldp transmitStops sending LLDP on one port (lldp receive is the other half).
In global configuration
no cdp runTurns CDP off on the whole device.

Port speed and duplex

Switch (2960)
Under interface Gi0/1
description Uplink to R1A note on the port, shown in show interfaces.
Under interface Fa0/2
speed 100Fixes the speed instead of autonegotiating. Two ends fixed at different speeds never link (notconnect); an auto end senses a fixed one.
duplex fullFixes 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 autoTurns 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.
shutdownDisables the port (no shutdown brings it back).
Switch (2960)
In privileged EXEC
show interfaces gi0/1The 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 errorsEvery 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 countersZeroes 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.