Networking

CCNA Command Cheat Sheet: Essential Cisco IOS Commands

Every CCNA command you actually need, grouped the way you use them, on one page you can keep open while you lab. This is the reference I reach for when configuring a device from scratch or troubleshooting one that will not behave, covering the IOS commands that come up across the whole 200-301 blueprint: device setup, interfaces, VLANs, routing, OSPF, verification, and the security basics.

Original content from computingforgeeks.com - post 169267

These are the commands I keep coming back to while labbing the CCNA topics; all run on Cisco IOS 15.x and are current as of June 2026.

Download the PDF cheat sheet

Basic device setup

The first commands on any fresh switch or router. Most run from global configuration mode after enable then configure terminal.

CommandWhat it does
enableEnter privileged EXEC mode
configure terminalEnter global configuration mode
hostname R1Set the device name
enable secret cisco123Set an encrypted privileged-mode password
service password-encryptionEncrypt plaintext passwords in the config
banner motd # text #Set a login banner
line console 0Enter console line config (then login, password)
line vty 0 4Enter the virtual terminal lines for remote access
no ip domain-lookupStop the device treating typos as DNS lookups

Interfaces and IP addressing

Bringing an interface up and giving it an address. Remember a router interface is shut down by default, so no shutdown is the line people forget.

CommandWhat it does
interface GigabitEthernet0/0Enter interface configuration mode
ip address 10.0.0.1 255.255.255.0Assign an IPv4 address and mask
no shutdownEnable the interface (bring it administratively up)
description LINK TO SW1Label the interface
interface range Gi0/1 - 2Configure several interfaces at once
ipv6 address 2001:db8::1/64Assign an IPv6 address
ipv6 unicast-routingEnable IPv6 routing (global, off by default)
show ip interface briefOne-line status and IP of every interface

VLANs and trunking

Switch-side configuration. Access ports carry one VLAN to a host; trunks carry many between switches.

CommandWhat it does
vlan 10Create VLAN 10 and enter VLAN config
name SALESName the VLAN
switchport mode accessSet the port as an access port
switchport access vlan 10Assign the access port to VLAN 10
switchport mode trunkSet the port as an 802.1Q trunk
switchport trunk allowed vlan 10,20Limit which VLANs the trunk carries
show vlan briefList VLANs and their assigned ports
show interfaces trunkShow trunk ports, native VLAN, allowed VLANs

Switching: MAC table and spanning tree

CommandWhat it does
show mac address-tableShow learned MAC-to-port mappings
show mac address-table dynamicShow only dynamically learned entries
show spanning-treeShow STP state, root bridge, and port roles
show spanning-tree vlan 10STP details for one VLAN
spanning-tree portfastSkip STP listening/learning on an access port

IP routing and static routes

CommandWhat it does
ip routingEnable IPv4 routing on a Layer 3 switch
ip route 192.168.2.0 255.255.255.0 10.0.0.2Add a static route via a next hop
ip route 0.0.0.0 0.0.0.0 10.0.0.2Add a default route
show ip routeShow the full routing table
show ip route staticShow only static routes

OSPF

Single-area OSPF, the routing protocol the CCNA leans on. The wildcard mask is the inverse of the subnet mask.

CommandWhat it does
router ospf 1Start OSPF process 1 and enter router config
network 10.0.0.0 0.0.0.255 area 0Advertise a network into OSPF area 0
router-id 1.1.1.1Set a stable OSPF router ID
passive-interface Gi0/1Stop OSPF hellos on an interface (no neighbors there)
show ip ospf neighborShow OSPF adjacencies and their state
show ip protocolsShow running routing protocols and networks

Verification and show commands

The commands you live in. When something is wrong, half the answer is in show running-config and show ip interface brief.

CommandWhat it does
show running-configShow the active configuration in memory
show startup-configShow the saved configuration in NVRAM
show versionIOS version, uptime, model, and the config register
show interfacesFull interface stats including error counters
show interfaces statusPer-port link, duplex, speed, and VLAN
show cdp neighborsDiscover directly connected Cisco devices
show cdp neighbors detailAdd neighbor IP and IOS version

Troubleshooting

CommandWhat it does
ping 10.0.0.2Test reachability to a host
traceroute 10.0.0.2Show the hop-by-hop path to a host
show ip interface briefSpot down or unaddressed interfaces fast
terminal monitorSee log and debug output over an SSH session
debug ip ospf eventsWatch OSPF activity live (turn off with no debug all)
no debug allStop all debugging

Security: SSH, ACLs, and port security

The gotcha with SSH is that it needs a hostname, a domain name, and an RSA key before the device will generate one.

CommandWhat it does
ip domain-name example.comSet the domain (required before key generation)
crypto key generate rsaGenerate the RSA key pair for SSH
ip ssh version 2Force SSH version 2
transport input sshAllow only SSH on the VTY lines
access-list 10 permit 10.0.0.0 0.0.0.255Standard numbered ACL entry
ip access-list extended WEBCreate a named extended ACL
switchport port-securityEnable port security on an access port
switchport port-security maximum 2Limit the port to two learned MACs

Save and manage the configuration

The single most important habit: save before you walk away. An unsaved config is gone on the next reload.

CommandWhat it does
copy running-config startup-configSave the active config to NVRAM
write memoryOlder shorthand for the same save
reloadRestart the device
show flashList files (including the IOS image) in flash
erase startup-configWipe the saved config (factory reset on reload)

Download the PDF cheat sheet

Keep this open while you work through the labs and the commands stick faster than memorising them cold. When you want the why behind any of these, the CCNA 200-301 study roadmap links the full hands-on guide for every topic, and the Domain 1 practice test checks whether the fundamentals have stuck.

Keep reading

Configure Samba File Share on Debian 13 / 12 Debian Configure Samba File Share on Debian 13 / 12 Setup WireGuard VPN on Ubuntu 24.04 / Debian 13 / Rocky Linux 10 Debian Setup WireGuard VPN on Ubuntu 24.04 / Debian 13 / Rocky Linux 10 Use NetworkManager nmcli on Ubuntu and Debian Debian Use NetworkManager nmcli on Ubuntu and Debian CCNA 200-301 Retake Policy: Rules After You Fail or Pass Networking CCNA 200-301 Retake Policy: Rules After You Fail or Pass CCNA vs CompTIA Network+: Which to Take First? Networking CCNA vs CompTIA Network+: Which to Take First? Installing Open vSwitch on Rocky 8 / AlmaLinux 8 AlmaLinux Installing Open vSwitch on Rocky 8 / AlmaLinux 8

Leave a Comment

Press ESC to close