Essential Cisco IOS command reference: exec modes, interface config, static routes, CDP/LLDP, file operations, hardware diagnostics, and common troubleshooting commands.
Basic Navigation and Modes
Modes and Basic Config
| Command | Description |
|---|---|
| enable | Enter privileged exec mode |
| configure terminal | Enter global configuration mode |
| end | Exit to privileged exec |
| hostname switch1 | Set device hostname |
| copy running-config startup-config | Save config (also: write) |
| configure replace nvram:startup-config | Fully replace running-config with startup-config (unlike copy, does not merge) |
| service compress-config | Compress running-config when saving to NVRAM |
| logging synchronous | Hold log messages until current command output finishes |
| no service config | Suppress "Error opening tftp://โฆ" messages on boot (takes effect after reload) |
Interfaces
Interface Configuration
| Command | Description |
|---|---|
| interface fastethernet 0/0 | Enter interface configuration |
| interface range fastethernet 0/0 - 3 | Configure multiple interfaces at once |
| ip address 192.168.0.1 255.255.255.0 | Set IP address |
| ip address dhcp | Get IP via DHCP |
| shutdown | Disable interface (no shutdown to enable) |
| no switchport | Put switch port into routed (L3) mode |
| ip proxy-arp | Enable Proxy ARP on interface |
Routing
Static Routes and DNS
| Command | Description |
|---|---|
| ip route 192.168.30.0 255.255.255.0 192.168.20.50 | Add static route |
| ip name-server 192.168.0.1 | Set DNS server |
| no ip cef | Disable Cisco Express Forwarding globally |
| no ip route-cache cef | Disable CEF on a specific interface |
CDP and LLDP
CDP / LLDP
| Command | Description |
|---|---|
| show cdp neighbors | List directly connected Cisco devices |
| cdp timer 5 | Send CDP packets every 5 seconds |
| cdp holdtime 10 | Declare neighbor dead after 10 s without CDP |
| no cdp run | Disable CDP globally |
| lldp run | Enable LLDP globally |
| lldp enable | Enable LLDP on interface |
| show lldp neighbors | List neighbors discovered via LLDP |
Show / Diagnostics
Interface and Routing Diagnostics
| Command | Description |
|---|---|
| show running-config | Active configuration |
| show startup-config | Saved configuration (used on next reboot) |
| show ip interface brief | All interfaces with IP addresses and status |
| show ip interface fa0/0 | Interface Layer 3 detail (IP, ACL, etc.) |
| show interface fa0/0 | Interface Layer 2 detail (errors, encapsulation) |
| show interface status | Status of all switch ports |
| show ip route | Routing table |
| show ip arp | ARP table (IP โ MAC) |
| show mac address-table int fa0/1 | MAC addresses seen on fa0/1 |
| show logging | Recent syslog messages |
| terminal monitor | Send console messages (including debug) to SSH/Telnet session |
| show control-plane host open-ports | Open TCP/UDP ports on the device |
| show processes cpu | CPU utilization per process |
| debug ip nat | Real-time NAT debug (may overload CPU โ use carefully) |
Hardware and Flash
Hardware Diagnostics
| Command | Description |
|---|---|
| show flash: | Flash memory contents and free space |
| show file system | Available flash and NVRAM space |
| show memory | RAM usage |
| show license | Installed IOS licenses |
| show platform tcam utilization | Remaining TCAM capacity (routes, ACLs, QoS entries) |
| show sdm prefer | Current SDM template (how TCAM is allocated) |
| sdm prefer dual-ipv4-and-ipv6 default | Switch TCAM allocation to support both IPv4 and IPv6 |
File Operations
Config Backup / Restore
| Command | Description |
|---|---|
| copy startup-config ftp://user:pass@172.10.1.2/backup.txt | Back up startup-config to FTP |
| copy ftp://user:pass@172.10.1.2/backup.txt startup-config | Restore startup-config from FTP |
Interface Speed & Duplex
Duplex Negotiation Matrix
| Local \ Remote | Half | Full | Auto |
|---|---|---|---|
| Half | Half โ | โ ๏ธ duplex mismatch | Half |
| Full | โ ๏ธ duplex mismatch | Full โ | Full โ |
| Auto | Half | Full โ | Full โ (best negotiated) |
Important: if one side has speed fixed to anything other than Auto and duplex is set to Full โ auto-negotiation is disabled. The other side will not negotiate and may default to Half, causing a duplex mismatch.
Speed & Duplex Commands
| Command | Description |
|---|---|
| speed 100 | Force interface speed to 100 Mbps |
| speed auto | Auto-negotiate speed (default) |
| duplex full | Force full duplex |
| duplex auto | Auto-negotiate duplex (default) |
| show int fa0/1 | Check current speed and duplex settings |
Cisco IOS Command Reference | General