Skip to content

CCNA CLI quick reference

Cisco CCNA (200-301) expects you to type, read, and troubleshoot IOS commands from memory, and the CLI simulations grade the exact sequence you enter. This sheet collects the mode navigation, verification commands, and base configuration recipes that appear most on the current v1.1 blueprint, plus the abbreviations you will see in real lab output. Commands work on both routers and Catalyst switches unless a row says otherwise.

Modes and navigation

CommandWhere it takes youPrompt afterRemember
(log in)User EXECSwitch>Limited show commands; no config changes
enablePrivileged EXECSwitch#disable drops back to user EXEC
configure terminalGlobal configSwitch(config)#The only door into configuration modes
interface g0/1Interface configSwitch(config-if)#interface range g0/1-24 edits many ports at once
line con 0 / line vty 0 15Line configSwitch(config-line)#Console is one line; vty lines carry SSH/Telnet sessions
exitUp one mode levelvariesFrom global config it lands in privileged EXEC
end (or Ctrl+Z)Privileged EXECSwitch#Jumps all the way out from any config depth
do <exec command>Stays in config modeunchangedRuns show/EXEC commands without leaving config, e.g. do sh run

Prompt text is the fastest clue in sim questions: > is user EXEC, # is privileged EXEC, (config)# and deeper are config modes.

Everyday verification

CommandQuestion it answersRemember
show running-configWhat is configured right now (in RAM)?Lost on reload unless copied to startup-config
show ip interface briefWhich interfaces are up, with what IPs?up/up is healthy; administratively down means it needs no shutdown
show vlan briefWhich VLANs exist and which access ports are in each?Trunk ports do not appear in the port list
show interfaces statusPer-port speed, duplex, VLAN, connected state?a-full / a-100 prefixes mean autonegotiated
show interfaces trunkWhich trunks formed; native and allowed VLANs?Empty output = no trunk formed (classic DTP auto/auto miss)
show ip routeWhich route will forward this destination?Longest prefix wins; codes: C connected, S static, O OSPF
show mac address-tableWhich port learned this MAC address?Dynamic entries age out after 300 seconds by default
show cdp neighborsWhat device and port sit at the far end of each link?Add detail for IP and IOS version; CDP is Cisco-only, LLDP is the open standard
show versionIOS version, uptime, model, config register?Register 0x2102 = normal boot; shown on the last line

Base switch and router config

TaskCommands (in order)Remember
Hostnamehostname SW1A non-default hostname is required before generating RSA keys
Login bannerbanner motd #No unauthorized access#The first character after motd is the delimiter that ends the text
Console passwordline con 0 ; password X ; loginBare login means: check the line password
Local user accountusername admin secret Str0ng!secret stores a hash; the older password keyword stores plaintext
Remote-access linesline vty 0 15 ; login local ; transport input sshlogin local checks username/secret pairs; transport input ssh blocks Telnet
Privileged-mode passwordenable secret XHashed, and always overrides an enable password if both exist
Hide plaintext passwordsservice password-encryptionWeak, reversible type 7; it obscures, it does not secure
Enable SSHip domain-name example.com ; crypto key generate rsa modulus 2048 ; ip ssh version 2Keys need hostname + domain name set first; SSHv2 needs at least 768-bit keys, and modern IOS XE (17.11.1+) requires 2048
Router interface IPinterface g0/0 ; ip address 10.1.1.1 255.255.255.0 ; no shutdownRouter ports default to shutdown; switch ports default to up
Switch management IPinterface vlan 1 ; ip address 10.1.1.2 255.255.255.0 ; no shutdownAn SVI (virtual interface), not a physical port
Switch default gatewayip default-gateway 10.1.1.1Global command on a Layer 2 switch so it can reach other subnets

VLANs and trunking

TaskCommands (in order)Remember
Create and name a VLANvlan 10 ; name SALESAssigning a port to a VLAN that does not exist auto-creates it
Access portswitchport mode access ; switchport access vlan 10One data VLAN per access port; a phone uses switchport voice vlan separately
Static trunkswitchport mode trunkOlder switches need switchport trunk encapsulation dot1q first
Stop DTP negotiationswitchport nonegotiateTwo ports left at dynamic auto will never form a trunk
Native VLANswitchport trunk native vlan 99Carries untagged frames; a mismatch triggers CDP warnings
Limit VLANs on a trunkswitchport trunk allowed vlan 10,20Without the add keyword the list is REPLACED, not appended
Verify the resultshow vlan brief ; show interfaces trunkAccess assignments in the first, formed trunks only in the second

Saving and abbreviations

Full commandShort formRemember
copy running-config startup-configcopy run startThe canonical save; writes the config to NVRAM so it survives reload
write memorywrLegacy equivalent of the save; still accepted and widely used
show running-configsh runAny unambiguous prefix of a keyword is accepted
configure terminalconf tThe most common abbreviation in lab walkthroughs
interface gigabitethernet0/1int g0/1Interface type and number compress together
show ip interface briefsh ip int brFastest first look at any device
no shutdownno shutPrefixing no reverses most commands
(context help)? and Tab? lists valid next keywords; Tab completes the current word

Reload without saving discards the running-config; IOS prompts to save modified config before reloading, and answering incorrectly is a classic exam trap.

Reading a sheet is recognition; the exam tests recall. The fastest way to make this stick is answering questions that use it.

Common questions

What is the difference between running-config and startup-config?

The running-config lives in RAM and reflects every change the moment you enter it; the startup-config lives in NVRAM and is what loads at boot. They diverge as soon as you configure anything, so copy running-config startup-config (or wr) is required to make changes permanent. A reload without saving reverts the device to the startup-config.

Why does crypto key generate rsa fail or SSH refuse to work?

RSA key generation requires a non-default hostname and a configured ip domain-name first, because the key is labeled with both. Use a 2048-bit modulus: SSH version 2 technically accepts 768 bits and up, but IOS XE 17.11.1 and later rejects keys smaller than 2048 by default. Also confirm the vty lines have login local, a username with a secret exists, and transport input allows SSH.

What is the difference between exit and end in Cisco IOS?

exit backs out exactly one mode level, so from interface config it returns to global config. end (or Ctrl+Z) jumps straight back to privileged EXEC from any configuration depth. In simulations, using end when you meant exit can leave you in the wrong mode for the next command, so watch the prompt.

Why won't a trunk form between two switches?

The usual cause is DTP defaults: two ports both set to dynamic auto passively wait and never negotiate a trunk. Configure switchport mode trunk on at least one side, or on both sides with switchport nonegotiate to disable DTP entirely. Then check show interfaces trunk and make sure the native VLAN matches on both ends.

More free practice tests

Back to all cert900 exams