Back to CCNA Roadmap

Cisco IOS Command Reference

The essential CLI commands required for the CCNA 200-301 exam and day-to-day network infrastructure management. Click any command for a deep-dive analysis.

1. Navigation & Basic Configuration

Command SyntaxDescription & Context
enableMove from User EXEC to Privileged EXEC mode.
configure terminalEnter Global Configuration mode (config).
hostname [name]Change the device hostname.
enable secret [password]Set an encrypted password for Privileged EXEC mode.
copy running-config startup-configSave the current configuration to NVRAM (alias: write memory or 'wr').
show running-configDisplay the currently active configuration in RAM.

2. SSH & Remote Access Management

Command SyntaxDescription & Context
ip domain-name [domain.com]Set the domain name (required for generating RSA keys).
crypto key generate rsaGenerate encryption keys for SSH. (Usually specify 2048 bits).
username [admin] privilege 15 secret [pass]Create a local user with maximum administrative privileges.
line vty 0 4Enter configuration for virtual terminal lines (SSH/Telnet).
transport input sshForce the switch/router to only accept SSH connections.
login localForce the VTY lines to use the local username database for authentication.

3. Interfaces & Switchports

Command SyntaxDescription & Context
interface [type] [number]Enter interface config mode (e.g., interface GigabitEthernet0/1).
interface range [type] [start-end]Configure multiple interfaces simultaneously (e.g., range g0/1 - 24).
description [text]Add a label to the interface for documentation purposes.
ip address [ip] [subnet mask]Assign an IPv4 address to a router interface or Switch Virtual Interface (SVI).
no shutdownAdministratively enable an interface (bring it 'up').
show ip interface briefShows all interfaces, their IPs, and their Up/Down status.

4. VLANs, VTP & 802.1Q Trunking

Command SyntaxDescription & Context
vlan [id]Create a VLAN and enter VLAN configuration mode.
name [vlan-name]Name the VLAN (e.g., name GUEST_WIFI).
switchport mode accessHardcode the interface as an access port.
switchport access vlan [id]Assign the access port to a specific VLAN.
switchport mode trunkHardcode the interface as an 802.1Q trunk port.
switchport nonegotiateDisable Dynamic Trunking Protocol (DTP) packets on the interface.
switchport trunk native vlan [id]Change the native (untagged) VLAN for security.
switchport trunk allowed vlan [id-id]Restrict which VLANs are allowed to cross the trunk.
vtp mode transparentDisables VTP participation on modern switches to prevent accidental VLAN wipeouts.
show vlan briefVerify VLAN creation and access port assignments.

5. Spanning Tree (STP) & EtherChannel

Command SyntaxDescription & Context
spanning-tree mode rapid-pvstEnable Rapid PVST+ for sub-second convergence.
spanning-tree vlan [id] root primaryMacro command to automatically lower the bridge priority and win the Root Bridge election.
spanning-tree portfastBypass listening/learning states on edge ports connected to end devices.
spanning-tree bpduguard enableErr-disable an edge port immediately if a BPDU is received, preventing rogue switches.
channel-group [id] mode activeBundle physical links into an EtherChannel using the open standard LACP protocol.
show etherchannel summaryVerify the status and protocol of your bundled Port-Channels.

6. IPv4 Routing (Static & OSPF)

Command SyntaxDescription & Context
ip routingEnable global IPv4 routing on a Multilayer Layer 3 Switch.
ip route [dest-network] [mask] [next-hop-ip]Create a static route.
router ospf [process-id]Enable OSPF routing process.
network [ip] [wildcard] area [id]Advertise networks into OSPF using wildcard masks (inverse of subnet mask).
passive-interface [type] [number]Prevent OSPF from sending hello packets out of a LAN interface.
default-information originateInject a default gateway route into the OSPF domain.
show ip ospf neighborVerify OSPF adjacencies and DR/BDR election states.
show ip routeDisplay the Layer 3 IPv4 routing table.

7. IPv6 Routing & Addressing

Command SyntaxDescription & Context
ipv6 unicast-routingEnable global IPv6 routing capabilities on the router.
ipv6 address [ipv6-address/prefix]Assign an IPv6 address to an interface.
ipv6 address autoconfigConfigure an interface to use SLAAC to obtain its IPv6 address.
ipv6 route ::/0 [next-hop-ip]Create an IPv6 default route.

8. IP Services (DHCP, NAT, NTP)

Command SyntaxDescription & Context
ip dhcp excluded-address [ip]Prevent the DHCP server from handing out specific statically assigned IPs.
ip dhcp pool [name]Create a local DHCP pool.
ip helper-address [ip]Convert DHCP broadcast requests into unicast packets for a remote server.
ip nat inside source static [local-ip] [global-ip]Configure 1-to-1 Static NAT mapping.
ip nat inside source list [acl] interface [type] overloadConfigure Port Address Translation (PAT) to share a single public IP.
ntp server [ip]Synchronize the device clock with an external Network Time Protocol server.

9. Security (ACLs & Port Security)

Command SyntaxDescription & Context
access-list [id] permit/deny [source-ip]Create an Access Control List to filter traffic.
ip access-group [id] [in/out]Apply an Access Control List to a specific interface.
ip dhcp snoopingEnable DHCP Snooping to mitigate rogue DHCP servers.
switchport port-securityEnable Layer 2 port security and define violation modes on an access interface.

10. Discovery & Troubleshooting

Command SyntaxDescription & Context
show cdp neighborsCisco Discovery Protocol: Shows directly connected Cisco devices.
show lldp neighborsLink Layer Discovery Protocol: The open-standard version of CDP.
show mac address-tableView the Layer 2 forwarding table mapping MAC addresses to switch ports.
ping [ip]Send ICMP echo requests to test Layer 3 connectivity.
traceroute [ip]Trace the hop-by-hop path packets take to a destination.
show ip arpView the ARP cache mapping Layer 3 IP addresses to Layer 2 MAC addresses.