π Cisco IOS Command Cheatsheet
This cheatsheet provides the essential Cisco IOS commands for navigation, configuration, verification, and basic troubleshooting of routers and switches. It mostly consists of commands from the first few modules of CCNA 1.
A couple of additional notes:
First, the DEL or DELETE key on your keyboard wonβt do what you might expect; Ctrl+D does that job. In fact, if youβre used to GNU readline (or emacs) nav and line editing commands, youβre in luck.
Second, experienced IOS users make heavy use of TAB and RETURN completion - IOS will try and complete any command that youβve entered the first few characters of.
π¦ Cisco IOS Command Modes
The CLI is hierarchical; you must be in the correct mode to execute a command.
| Mode Name | Prompt | Description |
|---|---|---|
| User EXEC Mode | Router> or Switch> | Basic monitoring and testing commands (ping, traceroute, limited show). |
| Privileged EXEC Mode | Router# or Switch# | Access to device management, monitoring, all config modes. Enter with enable. |
| Global Configuration Mode | Router(config)# | Commands that affect the entire device (hostname, passwords, services). Enter with configure terminal. |
| Interface Configuration Mode | Router(config-if)# | Commands for specific interfaces (IP addresses, speed, duplex). Enter with interface. |
| Line Configuration Mode | Router(config-line)# | Commands for console or remote access ports (passwords, login methods). Enter with line. |
Navigation Flow
A typical flow through the modes:
- Router> enable
- Router# conf t
- Router(config)# interface G0/0
- Router(config-if)# exit
- Router(config)# line console 0
- Router(config-line)# exit
- Router(config)# exit
- Router#
Quick Exit: To jump directly back to Priv EXEC Mode from any sub-config mode, do end or Ctrl+C.
βοΈ General Navigation and Setup
| Task | Command | Mode |
|---|---|---|
| Enter Privileged EXEC Mode | enable | User EXEC (>) |
| Set Privileged EXEC Password | enable secret PASS | Global Config ((config)#) |
| Enter Global Configuration Mode | configure terminal | Privileged EXEC (#) |
| Set Device Hostname | hostname NAME | Global Config ((config)#) |
| Set MOTD Banner | banner motd #Unauthorized users will be subjected to endless discourse on the editor wars.# | Global Config ((config)#) |
| Set Console Line Password | line console 0 β password PASS β login |
Global Config ((config)#) |
| Set Telnet or SSH Password | line vty 0 4 β password PASS β login |
Global Config ((config)#) |
| Encrypt Plaintext Passwords | service password-encryption | Global Config ((config)#) |
| Exit Current Mode | exit | All |
πΎ Configuration Management
| Task | Command | Mode |
|---|---|---|
| Save Configuration (RAM to NVRAM) | copy running-config startup-config (a useful alternative for dayschool is wr) |
Privileged EXEC (#) |
| Reload (Reboot) Device | reload | Privileged EXEC (#) |
| Erase Startup Configuration | erase startup-config | Privileged EXEC (#) |
π» Interfaces and Routing
| Task | Command | Mode |
|---|---|---|
| Enter Interface Configuration Mode | interface CODE (e.g., int g0/0) | Global Config ((config)#) |
| Assign an IPv4 Address and Mask | ip address IP MASK | Interface Config ((config-if)#) |
| Enable an Interface (Turn On) | no shutdown or no shut | Interface Config ((config-if)#) |
| Set an Interface Description | description TEXT | Interface Config ((config-if)#) |
| Set an IPv4 Static Route | ip route DEST_NET MASK NEXT_HOP | Global Config ((config)#) |
| Enable IPv6 Routing | ipv6 unicast-routing | Global Config ((config)#) |
π Switching and VLANs
| Task | Command | Mode |
|---|---|---|
| Configure Default Gateway on a Switch | ip default-gateway IP_ADDR | Global Config ((config)#) |
| Create a VLAN | vlan ID | Global Config ((config)#) |
| Assign an IP to a Switch VLAN | interface vlan ID β ip address IP MASK |
Global Config ((config)#) |
π Verification and Troubleshooting (Show Commands)
| Task | Command | Mode |
|---|---|---|
| View Current Running Configuration | show running-config | Privileged EXEC (#) |
| View Summary of Interface Status | show ip interface brief | Privileged EXEC (#) |
| View the Router's IP Routing Table | show ip route | Privileged EXEC (#) |
| View VLAN Information (on a switch) | show vlan | Privileged EXEC (#) |
| View MAC Address Table (on a switch) | show mac address-table | Privileged EXEC (#) |
| View Neighboring Cisco Devices (CDP) | show cdp neighbors detail | Privileged EXEC (#) |
| Check Connectivity | ping IP_ADDRESS | User/Privileged EXEC |
| Trace Path | traceroute IP_ADDRESS | User/Privileged EXEC |
| View Device's IOS Version/Uptime | show version | Privileged EXEC (#) |
π‘ Key Shortcuts and Tips
| Shortcut/Tip | Description |
|---|---|
| Tab | Completes a command if you've typed enough unique letters. |
| Ctrl+C | Ends the current configuration mode and returns directly to Privileged EXEC mode (#). (Same as end). |
| Ctrl+Shift+6 | Break sequence used to stop a running process or output (e.g., stopping a continuous ping). |
| do | Allows you to execute a command from a higher mode in a lower mode (e.g., Router(config)# do show ip interface brief). |
| ? | Context-sensitive help; shows available commands or next required parameter. |
| Up/Down Arrows | Scrolls through previously entered Command History. |
| logging synchronous | Used in line config mode to prevent system messages from interrupting command line input. |