TTR Networks

Beginner · Switching basics: layer 2, VLANs and IP addressing · section 6 of 7

Other switches, loops and troubleshooting

✓ Lab-tested 17 October 2026 on VyOS 2026.10.16-0024-rolling, Debian 12 (Linux bridge)

Every switch vendor uses the same concepts with slightly different words. This lab's switch is a Linux bridge (the same thing inside VyOS, Proxmox and most open-source routers); here's how the ideas map:

ConceptLinux bridge (this lab)Common names elsewhere
VLAN-aware switchvlan_filtering 1(always on)
Access port in VLAN 10bridge vlan add dev eth1 vid 10 pvid untagged"access VLAN 10", "untagged in VLAN 10"
Trunk carrying VLANs 10 and 20bridge vlan add dev eth4 vid 10, vid 20"trunk, allowed VLANs 10,20", "tagged in VLAN 10 and 20"
The untagged VLAN on a trunkpvid untagged on the trunk port"native VLAN"
MAC address tablebridge fdb show"MAC address table", "FDB"

Loops, and a story from this lab

Connect two switch ports together, directly or through other switches, and you've built a loop. A broadcast goes round it forever, multiplying at every switch, until the network is saturated: a broadcast storm. The Spanning Tree Protocol (STP) prevents this by finding loops and blocking one port in each. Most managed switches have it on by default (a Linux bridge doesn't). Leave it on.

The first version of this lab used Docker networks as the cables. Docker's bridges send broadcasts back to the port they came from (the VyOS labs had already shown this), so every port of the switch was effectively looped back to itself. Within seconds of the first ARP broadcast, Docker itself stopped responding, the classic symptom of a storm, and only a restart brought it back. The lab was rebuilt with plain virtual cables (veth pairs) instead. Loops are not a theoretical problem.

Checklist and troubleshooting

SymptomLook atUsual cause
Two hosts on the same switch can't talkTheir IP addresses and prefix lengths; their VLANsDifferent subnets with no gateway, or different VLANs
Host can't reach its gatewayThe VLAN on the host's port, and the VLANs allowed on the trunkThe VLAN is missing from the trunk, or the port is in the wrong VLAN
Gateway reachable, other VLANs notThe host's default route; the router's subinterfacesNo default gateway on the host, or a missing subinterface on the router
Everything slow, switches at 100% CPUPort counters; STP stateA loop, and a broadcast storm
A device moved and stopped workingThe switch's MAC tableIt's now on a port in a different VLAN

Check your understanding

A user plugs both ends of a spare cable into two ports of the same switch, and the whole office slows to a crawl. What happened?

  • A loop: broadcasts circulate forever and multiply (a broadcast storm), because STP is off or misconfigured
  • The switch ran out of MAC addresses
  • A duplicate IP address
  • The VLANs were merged