Basic Cisco IOS CLI Commands Cheat Sheet
by JKJK36 via cheatography.com/147654/cs/32114/
User Levels/Modes
Level Mode User View Some Available Commands
1 User EXEC Switch> enable
ping
show (basic only)
2 Privileged EXEC Switch# config
User EXEC commands
3 Global Config. Switch(config)# hostname
enable secret
interface/router/line
4a Interface Config. Switch(config-if)# shut/no shut
switchport mode
switchport access vlan
4b Router Config. Switch(config-router)# version
network
4c Line Config. Switch(config-line)# login
password
Changing User Mode
Command Abbreviated Command Change in Mode
>enable >en Moves from User Exec to Privileged EXEC
User is prompted for a password
#config terminal #config t Moves from Privileged EXEC to Global Config
(config)# interface [type/number] (config)# int [ type/number] Moves to Interface Config
(config)# vlan [#] (config)# vl [#] Moves to VLAN Config
exit Exits current mode and moves back to previous mode
Remember to enter the appropriate mode while configuring/working. Some commands will only work in specific modes.
Getting Started - Global Configuration
Command Purpose
hostname name Configure hostname on device
int vlan [#] Configure IP address on management VLAN
ip address[address][subnet mask]
vlan [#] Configures vlan with specified name
name [name/ip address]
ip default-gateway address Configure default gateway
banner motd #insert message # Configure banner message of the day
enable secret [secret] Enables specified secret on device
Some of the commands used during the base config. Others are in the Google Doc.
Important Show (sh) Commands
Command What it Shows
By JKJK36 Published 17th May, 2022. Sponsored by ApolloPad.com
cheatography.com/jkjk36/ Last updated 17th May, 2022. Everyone has a novel in them. Finish
Page 1 of 4. Yours!
https://apollopad.com
Basic Cisco IOS CLI Commands Cheat Sheet
by JKJK36 via cheatography.com/147654/cs/32114/
Important Show (sh) Commands (cont)
sh boot Boot path-list
sh cdp neighbors Cisco Discovery Protocol neighbors
sh int [ type/number] Network statistics of specified interface (status, input errors, etc.)
sh int status Names/statuses/VLANs/etc. of all interfaces
sh run int [ type/number] Running config on specified interface (switchport mode, switchport access vlan, etc.)
sh running-config (sh run) Current switch configuration
sh history Switch session command history
sh lldp neighbors Link Layer Discovery Protocol neighbors
sh logging Switch log (changes in int statuses)
sh power-inline Switch inline power (Available/Used/Remaining)
sh spanning-tree Spanning tree topology (Desg/Root)
sh spanning-tree vlan # 2nd command: STP of specific vlan
sh switch Switch stack information
sh version Hardware and software statuses
sh vlan VLANs/names/statuses/ports
Interface Types and Configuration
Components Application/Purpose
Type(s) Type changes with sw model:
FastEthernet (fa) 3550/60 - fa
GigabitEthernet (gi) 3750, 2960, 9200, 930024UN - gi
FiveGigabitEthernet (fi) 930048UN - fi
TenGigabitEthernet (te)
Stack Member Number Identifies int. switch stack position
1-8 (Ex: 1/0/1)
Module Number Identifies module number
0-1 (Ex: 1/1/1) 0 = switch port
1 = uplink port
Port Number Identifies int. number on switch
Ex: 1/0/1 - 1/0/48 1-48 = switch ports
1/1/1 - 1/1/4 1-4 = uplink ports
Config Commands for Interfaces
Command Purpose
switchport access vlan # Assigns interface to the specified VLAN
switchport mode [mode] Changes an interface's mode
Access
Trunk
switchport voice vlan # Assigns interface to the specified voice VLAN
By JKJK36 Published 17th May, 2022. Sponsored by ApolloPad.com
cheatography.com/jkjk36/ Last updated 17th May, 2022. Everyone has a novel in them. Finish
Page 2 of 4. Yours!
https://apollopad.com
Basic Cisco IOS CLI Commands Cheat Sheet
by JKJK36 via cheatography.com/147654/cs/32114/
Config Commands for Interfaces (cont)
ip dhcp snooping trust Enables the DHCP snooping security feature. Needed on trunk ports.*
*ip dhcp snooping trust will make the port trusted and DHCP server messages/traffic can flow through that interface. Messages will be dropped
otherwise.
Helpful Shortcuts on the Keyboard
Shortcut Purpose
Ctrl-Z Goes back to Privileged EXEC Mode (Switch#)
Tab Autofills the rest of the command
Up Arrow Types the last command entered
Right Click Pastes what is currently copied in the clipboard
Commands for when you don't want to type everything in Cisco CLI.
Commands for Wiping a Switch
Command Purpose
delete vlan.dat Deletes VLAN Database from switch
write erase Erases configuration files
reload Prompts the switch to reboot
These commands can be performed in Privileged EXEC Mode. After executing the reload command, do not save the system configuration, as
seen below:
System configuration has been modified. Save? [yes/no]: n
By JKJK36 Published 17th May, 2022. Sponsored by ApolloPad.com
cheatography.com/jkjk36/ Last updated 17th May, 2022. Everyone has a novel in them. Finish
Page 4 of 4. Yours!
https://apollopad.com