Everyday IOS habits

The commands below are the ones worth typing on every lab device before anything else, and the checklists to run through when a device is new. The Technical reference lists every command the live labs run.

Make the console pleasant

line console 0
 logging synchronous
 exec-timeout 30 0
line vty 0 15
 logging synchronous
 exec-timeout 30 0
!
no ip domain-lookup

Find things fast

CommandWhat it shows
show running-config | section line vtyOnly the vty lines' configuration
show running-config | begin router ospfThe configuration from the OSPF section on
show ip interface brief | include upOnly the interfaces that are up
show interfaces | include line protocol|errorsEach interface's state and error counters, two lines each
do show ip routeAny EXEC command from inside a configuration mode

Save, wipe and start again

GoalCommands
Savecopy running-config startup-config, or the shorter write memory (wr)
Wipe a routererase startup-config (or write erase), then reload without saving
Wipe a switchThe same, plus delete flash:vlan.dat: VLANs live in that file and survive an erased configuration

Passwords, in the right strength

SSH checklist

  1. A hostname other than the default: hostname SW1.
  2. A domain name: ip domain-name lab.local. The RSA key is named after the two.
  3. A key of at least 768 bits for SSH version 2; use 2048: crypto key generate rsa modulus 2048.
  4. ip ssh version 2. Without it IOS reports version 1.99, which still accepts the old, flawed version 1.
  5. A local user: username admin secret ….
  6. On the vty lines: transport input ssh and login local.
  7. Optional, against password guessing: login block-for 120 attempts 4 within 60 blocks new logins for 2 minutes after 4 failures within 1 minute.

A switch also needs an address to be reached: an SVI such as interface vlan 1 with ip address and no shutdown, and ip default-gateway for networks beyond its own.

Catalyst 9000: changing the licence level

A Catalyst 9300 or 9500 runs at the licence level it booted with. Moving up to Network Advantage takes a configuration line, a save and a reload.

configure terminal
 license boot level network-advantage addon dna-advantage
end
write memory
reload

IOS answers with a reminder that the change takes effect at the next boot. A warning about the boot variable at reload means boot system is not set; the switch still boots the first image it finds, but set it to be sure.