Cisco IOS commands for the CCNA
57 show and troubleshooting commands, grouped by topic. Each page has example output, what every field means, what to do when the output does not look right, and a lab to practise it in.
Switching Basics
- show ip interface brief — Lists every interface with its IPv4 address and its Layer 1 and Layer 2 status in one line each.
- show interfaces status — Shows each switch port’s link state, VLAN, duplex, speed and media type in one table.
- show interfaces — Shows the full detail for an interface: line status, MAC address, MTU, duplex and speed, traffic rates and error counters.
- show interfaces description — Lists every interface with its status, protocol and the description configured on it.
- show mac address-table — Shows which MAC addresses the switch has learned, in which VLAN, on which port.
- show ip arp — Shows the router’s ARP cache: which MAC address it has resolved for each IPv4 address, and on which interface.
VLANs
- show vlan brief — Lists every VLAN on the switch with its name, status and the access ports assigned to it.
- show vlan — Shows the full VLAN table: names, ports, and each VLAN’s type, MTU and other parameters.
- show vtp status — Shows the switch’s VTP version, domain name, operating mode and configuration revision number.
802.1Q Trunking
- show interfaces trunk — Lists every operational trunk with its mode, encapsulation, native VLAN and the VLANs allowed, active and forwarding on it.
- show interfaces switchport — Shows one port’s administrative and operational switchport mode, access VLAN, native VLAN and trunking settings.
Spanning Tree (STP)
- show spanning-tree — Shows, per VLAN, the root bridge, this switch’s bridge ID, and every port’s STP role, state and cost.
- show spanning-tree vlan — Shows the spanning-tree instance for one VLAN: root bridge, local bridge ID and port roles and states.
- show spanning-tree summary — Shows the STP mode, which protections are enabled globally, and a count of ports in each state per VLAN.
- show spanning-tree root — Lists the root bridge ID, root cost and root port for every VLAN on one screen.
Spanning Tree (STP) topic guide
EtherChannel
- show etherchannel summary — Lists every port-channel with its protocol, its state flags and whether each member port is bundled.
- show lacp neighbor — Shows the LACP partner seen on each member port: its system ID, port number and LACP flags.
Port Security
- show port-security — Summarises every port-security-enabled port: maximum and current MAC count, violation count and violation action.
- show port-security interface — Shows one port’s port-security status, violation mode, MAC limits, sticky addresses and last violating source.
- show port-security address — Lists every secure MAC address the switch holds, its VLAN, port and whether it is static, sticky or dynamic.
- show interfaces status err-disabled — Lists only the ports that are err-disabled, with the reason the switch shut each one.
- show errdisable recovery — Shows which err-disable causes recover automatically, the recovery timer, and ports waiting to recover.
- show ip arp inspection — Shows Dynamic ARP Inspection status per VLAN and counters of ARP packets forwarded and dropped.
Static Routing
- show ip route — Shows the IPv4 routing table: every network the router can reach, how it learned it, and the next hop or exit interface.
- show ip route static — Shows only the static routes that are installed in the routing table.
- ping — Sends ICMP echo requests to an address and reports how many replies came back and the round-trip times.
- traceroute — Lists each router hop on the path to a destination, so you can see where forwarding stops.
OSPF
- show ip ospf neighbor — Lists every OSPF neighbor with its router ID, priority, adjacency state, dead timer, address and interface.
- show ip ospf interface brief — Lists every OSPF-enabled interface with its process, area, address, cost, DR/BDR state and neighbor count.
- show ip ospf — Shows the OSPF process: router ID, SPF timers, how many areas and interfaces it runs, and how often SPF has run.
- show ip ospf database — Lists the link-state advertisements in this router’s OSPF database, by area and LSA type.
- show ip protocols — Shows each running routing protocol: router ID, networks it is routing for, passive interfaces and information sources.
- show ip route ospf — Shows only the routes learned from OSPF, with their administrative distance, metric and next hop.
Access Control Lists (ACLs)
- show access-lists — Lists every access list with its entries in order, their sequence numbers and how many packets each has matched.
- show ip interface — Shows an interface’s Layer 3 settings, including which access list is applied inbound and outbound.
Access Control Lists (ACLs) topic guide
NAT and PAT
- show ip nat translations — Lists the active NAT and PAT translations: inside local and global, outside local and global addresses and ports.
- show ip nat statistics — Shows NAT counters: active translations, inside and outside interfaces, hits and misses, and the configured rules.
DHCP
- show ip dhcp binding — Lists the addresses the router’s DHCP server has leased, to which client, and when each lease expires.
- show ip dhcp pool — Shows each DHCP pool’s size, how many addresses are leased and the address range it hands out.
- show ip dhcp snooping — Shows whether DHCP snooping is on, for which VLANs, and which interfaces are trusted.
- show ip dhcp snooping binding — Lists the MAC-to-IP bindings DHCP snooping recorded from leases seen on untrusted ports.
SSH and Device Hardening
- show ip ssh — Shows whether the SSH server is enabled, its version, and the authentication timeout and retry limits.
- show ssh — Lists the SSH sessions currently connected to the device, with version, cipher, state and username.
- show crypto key mypubkey rsa — Shows the RSA key pairs the device has generated, which SSH needs before it can start.
SSH and Device Hardening topic guide
IPv6
- show ipv6 interface brief — Lists every interface with its status and the IPv6 addresses on it, link-local first.
- show ipv6 route — Shows the IPv6 routing table: connected, local, static and dynamically learned prefixes and their next hops.
- show ipv6 neighbors — Shows the IPv6 neighbor cache, the NDP equivalent of the ARP table, with each neighbor’s state.
HSRP (First-Hop Redundancy)
- show standby brief — Shows one line per HSRP group: priority, preemption, state, the active and standby routers and the virtual IP.
- show standby — Shows each HSRP group in detail: virtual IP and MAC, timers, priority, preemption and which router is active.
HSRP (First-Hop Redundancy) topic guide
Device Management
- show running-config — Shows the configuration the device is running right now, including changes that have not been saved.
- show startup-config — Shows the configuration saved in NVRAM, which is what the device loads the next time it boots.
- show version — Shows the software version, uptime, image file, memory, interface count and configuration register.
- show cdp neighbors — Lists directly connected Cisco devices discovered with CDP: device ID, local and remote port, capability and platform.
- show cdp neighbors detail — Shows each CDP neighbor in full, including its management IP address and software version.
- show lldp neighbors — Lists directly connected devices discovered with the vendor-neutral LLDP protocol.
- show logging — Shows the logging configuration for each destination and the messages held in the local log buffer.
- show ntp associations — Lists the NTP servers the device is polling, their stratum and reachability, and which one it is synchronised to.