Show Menu
Cheatography

Basic Cisco IOS CLI Commands Cheat Sheet by

Some of the commands that can be used in Cisco IOS CLI.

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(co­nfig)#
hostname
enable secret
interf­ace­/ro­ute­r/line
4a
Interface Config.
Switch(co­nf­i­g­-if)#
shut/no shut
switchport mode
switchport access vlan
4b
Router Config.
Switch(co­nf­i­g­-ro­uter)#
version
network
4c
Line Config.
Switch(co­nf­i­g­-line)#
login
password

Changing User Mode

Command
Abbrev­iated 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/n­umber]
(config)# int [type/n­umber]
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 approp­riate mode while config­uri­ng/­wor­king. Some commands will only work in specific modes.

Getting Started - Global Config­uration

Command
Purpose
hostname name
Configure hostname on device
int vlan [#]
ip address[address][subnet mask]
Configure IP address on management VLAN
vlan [#]
name [name/ip address]
Configures vlan with specified name
ip defaul­t-g­ateway 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
sh boot
Boot path-list
sh cdp neighbors
Cisco Discovery Protocol neighbors
sh int [type/n­umber]
Network statistics of specified interface (status, input errors, etc.)
sh int status
Names/­sta­tus­es/­VLA­Ns/etc. of all interfaces
sh run int [type/n­umber]
Running config on specified interface (switc­hport mode, switchport access vlan, etc.)
sh runnin­g-c­onfig (sh run)
Current switch config­uration
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 (Avail­abl­e/U­sed­/Re­mai­ning)
sh spanni­ng-tree
sh spanni­ng-tree vlan #
Spanning tree topology (Desg/Root)
2nd command: STP of specific vlan
sh switch
Switch stack inform­ation
sh version
Hardware and software statuses
sh vlan
VLANs/­nam­es/­sta­tus­es/­ports

Interface Types and Config­uration

Components
Applic­ati­on/­Purpose
Type(s)
FastEthernet (fa)
GigabitEthernet (gi)
FiveGigabitEthernet (fi)
TenGigabitEthernet (te)
Type changes with sw model:
3550/60 - fa
3750, 2960, 9200, 930024UN - gi
930048UN - fi
Stack Member Number
1-8 (Ex: 1/0/1)
Identifies int. switch stack position
Module Number
0-1 (Ex: 1/1/1)
Identifies module number
0 = switch port
1 = uplink port
Port Number
Ex: 1/0/1 - 1/0/48
1/1/1 - 1/1/4
Identifies int. number on switch
1-48 = switch ports
1-4 = uplink ports

Config Commands for Interfaces

Command
Purpose
switchport access vlan #
Assigns interface to the specified VLAN
switchport mode [mode]
Access
Trunk
Changes an interf­ace's mode
switchport voice vlan #
Assigns interface to the specified voice VLAN
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 messag­es/­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 config­uration 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 config­ura­tion, as seen below:
System config­uration has been modified. Save? [yes/no]: n
  
 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          Cisco to Junos Cheat Sheet
          TCP/IP Model Layers Cheat Sheet
          Basic Cisco IOS Commands Cheat Sheet