Switching and Network Access · Topic 5 of 6
Layer 2 and Layer 3 Troubleshooting Tools
Troubleshoot Layer 2 and Layer 3 faults with show commands, show logging, ping, extended ping, traceroute and packet capture output, and read each result.
- 6 min
- Troubleshoot bottom up: port, VLAN, address, route, path.
show interfaces statusshows connected, notconnect, err-disabled and disabled.- Switches learn from source MAC addresses and forward by destination MAC addresses.
What it is
Troubleshooting means picking the right tool for the layer you suspect, and reading its output correctly.
Work from the bottom up: port and VLAN, then addresses and routes, then the path. Each tool answers a question at one of those layers.
| Tool | Question it answers |
|---|---|
show interfaces status, show ip interface brief | Is the port up, in the right VLAN, with the right speed and duplex? |
show mac address-table | Which port did the switch learn this device on? |
show logging | What did the device report, and when? |
ping, extended ping | Does the destination answer, and from which source? |
traceroute | Where along the path does it stop? |
| Packet capture | What was actually sent, and what came back? |
How it works
Start with the interface, follow the frames, then follow the packets.
Interface and MAC table
SW1# show interfaces status
Port Name Status Vlan Duplex Speed Type
Gi0/1 connected trunk a-full a-1000 10/100/1000BaseTX
Gi0/2 notconnect 10 auto auto 10/100/1000BaseTX
Gi0/3 err-disabled 10 auto auto 10/100/1000BaseTX
Gi0/4 disabled 20 auto auto 10/100/1000BaseTX
notconnect points to a cable or the far device. err-disabled means a protection feature shut the port. disabled means someone ran shutdown. The a- prefix shows autonegotiated values. A wrong VLAN number explains a host that cannot reach its gateway.
A switch learns from the source MAC address and forwards by the destination MAC address. Unknown unicast and broadcast frames are flooded in the VLAN, and entries age out after 300 seconds by default.
SW1# show mac address-table address 0050.56aa.bbcc
Vlan Mac Address Type Ports
10 0050.56aa.bbcc DYNAMIC Gi0/2
If the address is missing, the device is not sending, or is in another VLAN. Many addresses on one port mean a switch, hub or virtualized host. An address that keeps moving between ports points to a loop.
On the router side, show ip interface brief shows up/up when all is well, down/down for a physical fault, up/down for a Layer 2 or encapsulation problem, and administratively down/down after shutdown.
Logs
SW1# show logging
*Mar 1 00:05:12.123: %LINK-3-UPDOWN: Interface GigabitEthernet0/2, changed state to down
*Mar 1 00:05:13.125: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/2, changed state to down
Look for link flaps, err-disable events and native VLAN or duplex mismatch messages. Timestamps show when a fault began. Use terminal monitor to see live messages in an SSH session.
Ping and extended ping
R1# ping 10.2.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.2.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms
| Symbol | Meaning |
|---|---|
! | Reply received |
. | Timeout, no reply |
U | Destination unreachable received, often no route on a router in the path |
M | Could not fragment |
A plain ping uses the address of the exit interface as its source. The return path may not know that network. Extended ping lets you choose the source, repeat count, packet size and more.
R1# ping
Protocol [ip]:
Target IP address: 10.2.2.2
Repeat count [5]: 10
Datagram size [100]: 1500
Timeout in seconds [2]:
Extended commands [n]: y
Source address or interface: 192.168.10.1
You can also write ping 10.2.2.2 source GigabitEthernet0/0. Testing with the LAN address as the source proves the whole path. Testing with a large size and the DF bit set finds an MTU problem.
Traceroute
R1# traceroute 10.3.3.3
Type escape sequence to abort.
Tracing the route to 10.3.3.3
1 10.1.12.2 2 msec 1 msec 1 msec
2 10.1.23.3 3 msec 2 msec 2 msec
3 * * *
Each line is one hop. The last good hop is the device that has no route onward, or the next hop is down. Asterisks can also mean a device or firewall does not answer, so confirm with the routing table on the last good hop. Windows uses tracert.
Packet capture output
Capture tools show what crossed the wire. On a switch, a SPAN session copies traffic from one port to a port where a capture device is plugged in.
monitor session 1 source interface GigabitEthernet0/1
monitor session 1 destination interface GigabitEthernet0/10
Read capture lines as who sent what to whom.
10:15:01 ARP, Request who-has 10.1.1.1 tell 10.1.1.10, length 28
10:15:02 IP 10.1.1.10 > 10.2.2.2: ICMP echo request, id 1, seq 1, length 40
10:15:03 IP 10.1.1.1 > 10.1.1.10: ICMP host unreachable
- Repeated ARP requests with no reply mean the gateway is not answering at Layer 2. Check the VLAN, the cable and the IP address.
- An echo request with no echo reply means the packet was lost or filtered on the way.
- An ICMP unreachable names the device that sent it, which tells you where the path ends.
A ping that works to the gateway but fails beyond it points to routing. A ping that fails to the gateway points to Layer 1 or 2 or the address.
Common mistakes
Ping from the wrong source. A router pings from its exit interface, and the reply may have no route back. Use extended ping with the right source.
Reading * * * as a dead end. The device may simply not reply to traceroute.
Skipping Layer 1. Check show interfaces status before the routing table.
One failed ping proves little. A firewall or an ACL can drop ICMP while real traffic works.
What to remember for the exam
- Troubleshoot bottom up: port, VLAN, address, route, path.
show interfaces statusshows connected, notconnect, err-disabled and disabled.- Switches learn from source MAC addresses and forward by destination MAC addresses.
show ip interface briefshows up/down combinations, andshow loggingshows time stamped events.!is a reply,.is a timeout andUis unreachable.- Extended ping chooses the source, size and repeat count.
- Traceroute shows each hop, and the last good hop is where to look next.
- In a capture, unanswered ARP, unanswered echo and ICMP unreachable each point to a different fault.
Check yourself
A switch port shows err-disabled in show interfaces status. What does that mean?
A protection feature on the switch shut the port down. Check show logging for the reason, fix it, then reset the port.
Why use extended ping instead of a plain ping on a router?
Extended ping lets you set the source address, so you can test the return path from the LAN, and also set the size and repeat count.
A capture shows ARP requests for the gateway with no replies. What does it suggest?
The gateway is not answering at Layer 2. Check the VLAN, the cable and the IP configuration.
Topic 5 of 6 in Switching and Network Access
Test yourself on Switching and Network Access
The full Cisco CCNA 200-301 v2.0 question bank has 1,242 questions, with timed practice exams and an explanation for every answer.
This study guide is independent and is not affiliated with, endorsed by, or sponsored by Cisco. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.