A real-life situation
You are connected to a router in a wiring closet you have never seen. There is no diagram. Within a minute you want to know: which ports are up, what is plugged into them, and where the router sends traffic. A handful of show commands answer all three.
What show commands are
On Cisco IOS, show commands display the current state of the device. They only read; they never change anything, so they are safe to run at any time. Run them from privileged EXEC mode (the # prompt).
| Question | Command |
|---|---|
| Which interfaces are up, with which IPs? | show ip interface brief |
| Speed, duplex, errors on one interface? | show interfaces g0/1 |
| Which Cisco devices are connected where? | show cdp neighbors |
| Where does the router send traffic? | show ip route |
| Which ports are in which VLAN? (switch) | show vlan brief |
| Which links are trunks, carrying which VLANs? (switch) | show interfaces trunk |
| Status, VLAN, speed of every switch port? | show interfaces status |
- 1. show ip interface brief: three interfaces up, with their addresses.
- 2. show cdp neighbors: SW1 and SW2 are connected, each on its port Gi1/0/24.
- 3. show ip route: the default route points out Gi0/0 toward the ISP.
Reading the output
All output on this page is based on Cisco documentation, not run on a lab device.
R1#show ip interface brief Interface IP-Address OK? Method Status Protocol GigabitEthernet0/0 198.51.100.2 YES NVRAM up up GigabitEthernet0/1 192.168.10.1 YES NVRAM up up GigabitEthernet0/2 192.168.20.1 YES NVRAM up down GigabitEthernet0/3 unassigned YES NVRAM administratively down down
shutdown command.| Status / Protocol | Meaning | Look at |
|---|---|---|
| up / up | Working | Higher layers if there is still a problem |
| down / down | No physical link | Cable, the device at the other end, speed settings |
| up / down | Link but Layer 2 fails | Encapsulation, keepalives, the far end's config |
| administratively down / down | Shut down by an admin | no shutdown |
R1#show cdp neighbors Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone Device ID Local Intrfce Holdtme Capability Platform Port ID SW1 Gig 0/1 152 S I C9200L-24 Gig 1/0/24 SW2 Gig 0/2 147 S I C9200L-24 Gig 1/0/24
R1#show ip route Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP O - OSPF, IA - OSPF inter area, * - candidate default Gateway of last resort is 198.51.100.1 to network 0.0.0.0 S* 0.0.0.0/0 [1/0] via 198.51.100.1 192.168.10.0/24 is variably subnetted, 2 subnets, 2 masks C 192.168.10.0/24 is directly connected, GigabitEthernet0/1 L 192.168.10.1/32 is directly connected, GigabitEthernet0/1 198.51.100.0/24 is variably subnetted, 2 subnets, 2 masks C 198.51.100.0/30 is directly connected, GigabitEthernet0/0 L 198.51.100.2/32 is directly connected, GigabitEthernet0/0
Why filtering helps
Long output hides the line you need. Add a pipe to filter it: show running-config | section interface, show ip route | include 192.168.20 or show interfaces | include line protocol|errors. In configuration mode, put do in front to run a show command without leaving it.
Check yourself
show ip interface brief shows an interface as 'administratively down / down'. What fixes it?
Which command tells you the port number on the switch at the other end of a cable?
An interface is up/down. Why is its connected network missing from the routing table?