STP: backup path

Disconnect a link and test STP failover.

Network

Scroll sideways to exploreOpen full diagram
PC1 attaches to SW1 and PC2 to SW2; SW1, SW2 and SW3 form an STP-enabled triangle.
STP is enabled. SW1 is the root bridge.
Open a console

1. Find the blocked port

SW3

brctl showstp br0

Wait for eth1 to enter blocking.

brctl showstp br0 > /tmp/lab-stp-before.txt

PC1

ping -n -c 3 -W 1 192.168.1.2

2. Disconnect the primary path

SW1

ip link set dev eth1 down
sleep 50

SW3

brctl showstp br0 > /tmp/lab-stp-after.txt
cat /tmp/lab-stp-after.txt

SW3

timeout 120 tcpdump -U --immediate-mode -i eth1 -w /tmp/lab-stp.pcap "icmp" &
capture_pid=$!
sleep 1

PC1

ping -n -c 3 -W 1 192.168.1.2

SW3

sleep 2
kill -INT "$capture_pid"
wait "$capture_pid" || true
tcpdump -nn -e -r /tmp/lab-stp.pcap

The ping should succeed via SW3. Its eth1 is now forwarding, and the capture contains ICMP.

SW1

ip link set dev eth1 up
sleep 50

SW3

brctl showstp br0

PC1

ping -n -c 3 -W 1 192.168.1.2

The ping succeeds again, and SW3’s backup eth1 returns to blocking.

Validation

Click "Check". Once all steps pass, click "End".