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 Syntax | Description & Context |
|---|---|
| enable | Move from User EXEC to Privileged EXEC mode. |
| configure terminal | Enter 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-config | Save the current configuration to NVRAM (alias: write memory or 'wr'). |
| show running-config | Display the currently active configuration in RAM. |
2. SSH & Remote Access Management
| Command Syntax | Description & Context |
|---|---|
| ip domain-name [domain.com] | Set the domain name (required for generating RSA keys). |
| crypto key generate rsa | Generate 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 4 | Enter configuration for virtual terminal lines (SSH/Telnet). |
| transport input ssh | Force the switch/router to only accept SSH connections. |
| login local | Force the VTY lines to use the local username database for authentication. |
3. Interfaces & Switchports
| Command Syntax | Description & 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 shutdown | Administratively enable an interface (bring it 'up'). |
| show ip interface brief | Shows all interfaces, their IPs, and their Up/Down status. |
4. VLANs, VTP & 802.1Q Trunking
| Command Syntax | Description & Context |
|---|---|
| vlan [id] | Create a VLAN and enter VLAN configuration mode. |
| name [vlan-name] | Name the VLAN (e.g., name GUEST_WIFI). |
| switchport mode access | Hardcode the interface as an access port. |
| switchport access vlan [id] | Assign the access port to a specific VLAN. |
| switchport mode trunk | Hardcode the interface as an 802.1Q trunk port. |
| switchport nonegotiate | Disable 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 transparent | Disables VTP participation on modern switches to prevent accidental VLAN wipeouts. |
| show vlan brief | Verify VLAN creation and access port assignments. |
5. Spanning Tree (STP) & EtherChannel
| Command Syntax | Description & Context |
|---|---|
| spanning-tree mode rapid-pvst | Enable Rapid PVST+ for sub-second convergence. |
| spanning-tree vlan [id] root primary | Macro command to automatically lower the bridge priority and win the Root Bridge election. |
| spanning-tree portfast | Bypass listening/learning states on edge ports connected to end devices. |
| spanning-tree bpduguard enable | Err-disable an edge port immediately if a BPDU is received, preventing rogue switches. |
| channel-group [id] mode active | Bundle physical links into an EtherChannel using the open standard LACP protocol. |
| show etherchannel summary | Verify the status and protocol of your bundled Port-Channels. |
6. IPv4 Routing (Static & OSPF)
| Command Syntax | Description & Context |
|---|---|
| ip routing | Enable 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 originate | Inject a default gateway route into the OSPF domain. |
| show ip ospf neighbor | Verify OSPF adjacencies and DR/BDR election states. |
| show ip route | Display the Layer 3 IPv4 routing table. |
7. IPv6 Routing & Addressing
| Command Syntax | Description & Context |
|---|---|
| ipv6 unicast-routing | Enable global IPv6 routing capabilities on the router. |
| ipv6 address [ipv6-address/prefix] | Assign an IPv6 address to an interface. |
| ipv6 address autoconfig | Configure 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 Syntax | Description & 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] overload | Configure 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 Syntax | Description & 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 snooping | Enable DHCP Snooping to mitigate rogue DHCP servers. |
| switchport port-security | Enable Layer 2 port security and define violation modes on an access interface. |
10. Discovery & Troubleshooting
| Command Syntax | Description & Context |
|---|---|
| show cdp neighbors | Cisco Discovery Protocol: Shows directly connected Cisco devices. |
| show lldp neighbors | Link Layer Discovery Protocol: The open-standard version of CDP. |
| show mac address-table | View 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 arp | View the ARP cache mapping Layer 3 IP addresses to Layer 2 MAC addresses. |