Home Blog Certs Knowledge Base About

Cisco IOS โ€” General Commands

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
CommandDescription
enableEnter privileged exec mode
configure terminalEnter global configuration mode
endExit to privileged exec
hostname switch1Set device hostname
copy running-config startup-configSave config (also: write)
configure replace nvram:startup-configFully replace running-config with startup-config (unlike copy, does not merge)
service compress-configCompress running-config when saving to NVRAM
logging synchronousHold log messages until current command output finishes
no service configSuppress "Error opening tftp://โ€ฆ" messages on boot (takes effect after reload)

Interfaces

Interface Configuration
CommandDescription
interface fastethernet 0/0Enter interface configuration
interface range fastethernet 0/0 - 3Configure multiple interfaces at once
ip address 192.168.0.1 255.255.255.0Set IP address
ip address dhcpGet IP via DHCP
shutdownDisable interface (no shutdown to enable)
no switchportPut switch port into routed (L3) mode
ip proxy-arpEnable Proxy ARP on interface

Routing

Static Routes and DNS
CommandDescription
ip route 192.168.30.0 255.255.255.0 192.168.20.50Add static route
ip name-server 192.168.0.1Set DNS server
no ip cefDisable Cisco Express Forwarding globally
no ip route-cache cefDisable CEF on a specific interface

CDP and LLDP

CDP / LLDP
CommandDescription
show cdp neighborsList directly connected Cisco devices
cdp timer 5Send CDP packets every 5 seconds
cdp holdtime 10Declare neighbor dead after 10 s without CDP
no cdp runDisable CDP globally
lldp runEnable LLDP globally
lldp enableEnable LLDP on interface
show lldp neighborsList neighbors discovered via LLDP

Show / Diagnostics

Interface and Routing Diagnostics
CommandDescription
show running-configActive configuration
show startup-configSaved configuration (used on next reboot)
show ip interface briefAll interfaces with IP addresses and status
show ip interface fa0/0Interface Layer 3 detail (IP, ACL, etc.)
show interface fa0/0Interface Layer 2 detail (errors, encapsulation)
show interface statusStatus of all switch ports
show ip routeRouting table
show ip arpARP table (IP โ†” MAC)
show mac address-table int fa0/1MAC addresses seen on fa0/1
show loggingRecent syslog messages
terminal monitorSend console messages (including debug) to SSH/Telnet session
show control-plane host open-portsOpen TCP/UDP ports on the device
show processes cpuCPU utilization per process
debug ip natReal-time NAT debug (may overload CPU โ€” use carefully)

Hardware and Flash

Hardware Diagnostics
CommandDescription
show flash:Flash memory contents and free space
show file systemAvailable flash and NVRAM space
show memoryRAM usage
show licenseInstalled IOS licenses
show platform tcam utilizationRemaining TCAM capacity (routes, ACLs, QoS entries)
show sdm preferCurrent SDM template (how TCAM is allocated)
sdm prefer dual-ipv4-and-ipv6 defaultSwitch TCAM allocation to support both IPv4 and IPv6

File Operations

Config Backup / Restore
CommandDescription
copy startup-config ftp://user:pass@172.10.1.2/backup.txtBack up startup-config to FTP
copy ftp://user:pass@172.10.1.2/backup.txt startup-configRestore startup-config from FTP

Interface Speed & Duplex

Duplex Negotiation Matrix
Local \ RemoteHalfFullAuto
HalfHalf โœ“โš ๏ธ duplex mismatchHalf
Fullโš ๏ธ duplex mismatchFull โœ“Full โœ“
AutoHalfFull โœ“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
CommandDescription
speed 100Force interface speed to 100 Mbps
speed autoAuto-negotiate speed (default)
duplex fullForce full duplex
duplex autoAuto-negotiate duplex (default)
show int fa0/1Check current speed and duplex settings

Cisco IOS Command Reference | General