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 CCNA 200-301 topics in both v1.1 and v2.0: device setup, interfaces, VLANs, routing, OSPF, verification, and the security basics. Every command here was run on Cisco IOS 15.x in my GNS3 lab, and the page was last reviewed in November 2026.
Original content from computingforgeeks.com - post 169267
Basic device setup
The first commands on any fresh switch or router. Most run from global configuration mode after enable then configureterminal.
Command
What it does
enable
Enter privileged EXEC mode
configureterminal
Enter global configuration mode
hostnameR1
Set the device name
enablesecretcisco123
Set an encrypted privileged-mode password
servicepassword-encryption
Encrypt plaintext passwords in the config
bannermotd#text#
Set a login banner
lineconsole0
Enter console line config (then login, password)
linevty04
Enter the virtual terminal lines for remote access
noipdomain-lookup
Stop 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 noshutdown is the line people forget.
Command
What it does
interfaceGigabitEthernet0/0
Enter interface configuration mode
ipaddress10.0.0.1255.255.255.0
Assign an IPv4 address and mask
noshutdown
Enable the interface (bring it administratively up)
descriptionLINKTOSW1
Label the interface
interfacerangeGi0/1-2
Configure several interfaces at once
ipv6address2001:db8::1/64
Assign an IPv6 address
ipv6unicast-routing
Enable IPv6 routing (global, off by default)
showipinterfacebrief
One-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.
Command
What it does
vlan10
Create VLAN 10 and enter VLAN config
nameSALES
Name the VLAN
switchportmodeaccess
Set the port as an access port
switchportaccessvlan10
Assign the access port to VLAN 10
switchportmodetrunk
Set the port as an 802.1Q trunk
switchporttrunkallowedvlan10,20
Limit which VLANs the trunk carries
showvlanbrief
List VLANs and their assigned ports
showinterfacestrunk
Show trunk ports, native VLAN, allowed VLANs
Switching: MAC table and spanning tree
Command
What it does
showmacaddress-table
Show learned MAC-to-port mappings
showmacaddress-tabledynamic
Show only dynamically learned entries
showspanning-tree
Show STP state, root bridge, and port roles
showspanning-treevlan10
STP details for one VLAN
spanning-treeportfast
Skip STP listening/learning on an access port
IP routing and static routes
Command
What it does
iprouting
Enable IPv4 routing on a Layer 3 switch
iproute192.168.2.0255.255.255.010.0.0.2
Add a static route via a next hop
iproute0.0.0.00.0.0.010.0.0.2
Add a default route
showiproute
Show the full routing table
showiproutestatic
Show only static routes
OSPF
Single-area OSPF, the routing protocol the CCNA leans on. The wildcard mask is the inverse of the subnet mask.
Command
What it does
routerospf1
Start OSPF process 1 and enter router config
network10.0.0.00.0.0.255area0
Advertise a network into OSPF area 0
router-id1.1.1.1
Set a stable OSPF router ID
passive-interfaceGi0/1
Stop OSPF hellos on an interface (no neighbors there)
showipospfneighbor
Show OSPF adjacencies and their state
showipprotocols
Show running routing protocols and networks
Verification and show commands
The commands you live in. When something is wrong, half the answer is in showrunning-config and showipinterfacebrief.
Command
What it does
showrunning-config
Show the active configuration in memory
showstartup-config
Show the saved configuration in NVRAM
showversion
IOS version, uptime, model, and the config register
showinterfaces
Full interface stats including error counters
showinterfacesstatus
Per-port link, duplex, speed, and VLAN
showcdpneighbors
Discover directly connected Cisco devices
showcdpneighborsdetail
Add neighbor IP and IOS version
Troubleshooting
Command
What it does
ping10.0.0.2
Test reachability to a host
traceroute10.0.0.2
Show the hop-by-hop path to a host
showipinterfacebrief
Spot down or unaddressed interfaces fast
terminalmonitor
See log and debug output over an SSH session
debugipospfevents
Watch OSPF activity live (turn off with no debug all)
nodebugall
Stop 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.
Command
What it does
ipdomain-nameexample.com
Set the domain (required before key generation)
cryptokeygeneratersa
Generate the RSA key pair for SSH
ipsshversion2
Force SSH version 2
transportinputssh
Allow only SSH on the VTY lines
access-list10permit10.0.0.00.0.0.255
Standard numbered ACL entry
ipaccess-listextendedWEB
Create a named extended ACL
switchportport-security
Enable port security on an access port
switchportport-securitymaximum2
Limit 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.
Command
What it does
copyrunning-configstartup-config
Save the active config to NVRAM
writememory
Older shorthand for the same save
reload
Restart the device
showflash
List files (including the IOS image) in flash
erasestartup-config
Wipe the saved config (factory reset on reload)
Keep this open while you work through the free CCNA 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. To see what has stuck, the free CCNA practice questions have a drill for each v2.0 domain and a timed 100-question mock that scores you per domain.
Founder of Computingforgeeks. Senior Systems Engineer with over a decade of hands-on experience building and managing production infrastructure. Core expertise in Linux/UNIX administration, cloud platforms (AWS, GCP, Azure), and Kubernetes ecosystems (EKS, GKE, OpenShift). Deep experience with virtualization (KVM, Proxmox, OpenStack), infrastructure as code (Terraform, Terragrunt, Ansible, Crossplane), GitOps workflows (ArgoCD, FluxCD), Nix/NixOS, and container orchestration at scale. Currently focused on integrating AI and LLMs into DevOps and platform engineering workflows. Every guide on this site is tested on real systems before publishing.