Wednesday, December 14, 2022

Cisco IOS Command Cheat Sheet

Quick post - I wanted to put together a quick post to give a "cheat sheet" for the basic Cisco IOS commands to use as a reference.  The most important command is the help command.  No matter where you are, typing in "?" will always give you information about what commands are available in each mode, and what you can do with those commands.

Here is a quick tutorial on the commands below put together by the danscourses YouTube channel that goes along with this command reference that he put together for the video.  

NOTE: The command reference below is for the most common commands used by a variety of Cisco devices, and are meant to introduce you to the fundamentals.  There are Cisco commands, however, that are sometimes unique to a specific Cisco IOS release, may be added, deprecated, or changed.  Always check the documentation for your specific hardware.




================================= Basic Router Commands ================================= Router> ---User EXEC mode exit Router> ? Router> enable --------------- Router# ---Privileged EXEC mode disable, exit Router# ? ----------------- Router# configure terminal Router(config)# ---Global Config mode exit, end, Ctrl+c, Ctrl+z Router(config)# ? ----------------- Router(config)# line vty 0 15 Router(config)# line console 0 Router(config-line)# ---Line configuration mode exit, end, Ctrl+c, Ctrl+z Router(config-line)# ? ---------------------------- Router(config)# interface gigabitEthernet 0/0/0 Router(config-if)# ---Interface configuration mode exit, end, Ctrl+c, Ctrl+z Router(config-if)# ? ---------------------------- Router# Router# configure terminal Router# show ? Router# show running-config Router# copy running-config startup-config Router# ping 192.168.1.100 Router# traceroute 192.168.1.100 Router# ssh 192.168.1.100 Router# telnet 192.168.1.100 Router# debug ? Router# clock set 07:14:00 October 15 2019 Router# reload --------------------------------- Router(config)# Router(config)# hostname R1 Router(config)# banner motd "No unauthorized access allowed!" Router(config)# enable password class Router(config)# enable secret class12345 //should be a different password than the unencrypted password Router(config)# service password-encryption Router(config)# line vty 0 15 Router(config)# line console 0 Router(config)# interface gigabitEthernet 0/0/0 ---------------------------------------------------- Router(config-line)# Router(config-line)# password cisco Router(config-line)# login Router(config-line)# transport input all (line vty) ---------------------------------------------------- Router(config-if)# Router(config-if)# interface gigabitEthernet 0/0/0 Router(config-if)# int g0/0 //command abbreviation Router(config-if)# ip address 192.168.1.1 255.255.255.0 Router(config-if)# no shutdown ================================= Basic Switch Commands ================================= Switch> ---User EXEC mode exit Switch> enable --------------- Switch# ---Privileged EXEC mode disable, exit ----------------- Switch# configure terminal Switch(config)# ---Global Config mode exit, end, Ctrl+c, Ctrl+z ----------------- Switch(config)# line vty 0 15 Switch(config)# line console 0 Switch(config-line)# ---Line configuration mode exit, end, Ctrl+c, Ctrl+z ---------------------------- Switch(config)# interface vlan 1 Switch(config-if)# ---Interface configuration mode exit, end, Ctrl+c, Ctrl+z ---------------------------- Switch# Switch# configure terminal Switch# show ? Switch# show running-config Switch# copy running-config startup-config Switch# ping 192.168.1.100 Switch# traceroute 192.168.1.100 Switch# ssh 192.168.1.100 Switch# telnet 192.168.1.100 Switch# debug ? Switch# clock set 07:14:00 October 15 2019 Switch# reload --------------------------------- Switch(config)# Switch(config)# hostname R1 Switch(config)# banner motd "No unauthorized access allowed!" Switch(config)# enable password class Switch(config)# enable secret class Switch(config)# service password-encryption Switch(config)# line vty 0 15 Switch(config)# line console 0 Switch(config)# interface vlan 1 ---------------------------------------------------- Switch(config-line)# Switch(config-line)# password cisco Switch(config-line)# login Switch(config-line)# transport input all (line vty) ---------------------------------------------------- Switch(config-if)# Switch(config-if)# interface vlan 1 Switch(config-if)# ip address 192.168.1.2 255.255.255.0 Switch(config-if)# no shutdown Switch(config-if)# exit Switch(config)# ip default-gateway 192.168.1.1

========================= Extra Helpful Commands: ========================= Router# show ip interface brief //Gives you information about the IP configuration of each interface. Great for troubleshooting.

Router(conf)# no ip domain-lookup //prevents miss-typed commands from being "translated..." Router(conf-line)# logging synchronous //prevents logging output from interrupting your command input


Additional Information:

My Cisco IOS Playlist (Check often as I update it frequently): https://www.youtube.com/playlist?list=PLm9GBPmQ-2CaovCCrLM9gkvNgmhLej53j

Cisco IOS Command Configuration Fundamentals Command Reference: https://www.cisco.com/c/en/us/td/docs/ios/fundamentals/command/reference/cf_book.html

10 Commands You Should Master When Working with the Cisco IOS:
https://www.techrepublic.com/article/10-commands-you-should-master-when-working-with-the-cisco-ios-104071/