Skip to content

Lesson 4 of 9 · 25m

Interfaces, Bridges, and the Linux Networking Model Inside OpenWrt

Translate physical ports, CPU links, bridges, interfaces, and firewall zones into one coherent packet-flow model.

Most bad OpenWrt configurations are not VLAN mistakes or firewall mistakes. They are model mistakes. The administrator thinks in terms of plastic labels — LAN1, LAN2, WAN — while Linux thinks in terms of switch ports, CPU-facing interfaces, bridges, routes, and netfilter hooks. Once you redraw the box as a packet path, advanced configuration stops being guesswork.

Draw the physical truth first

A typical small router contains a switch fabric wired to Ethernet jacks, one or more CPU ports, and wireless radios that appear as separate Linux interfaces.

Newer targets often use DSA, where ports appear as Linux interfaces named lan1, lan2, and wan. The topology principle survives, but syntax differs. Verify before copying examples:

ip link show
bridge link
ip addr show

OpenWrt separates device and interface

In /etc/config/network, a device is lower-layer plumbing, while an interface is logical configuration such as LAN addressing or WAN DHCP:

config device
    option name 'br-lan'
    option type 'bridge'
    list ports 'lan1'

config interface 'lan'
    option device 'br-lan'
    option proto 'static'
    option ipaddr '192.168.1.1'
    option netmask '255.255.255.0'

Confusing those layers creates the classic mistake: correct IP addresses attached to the wrong physical ports.

Follow one packet end to end

A LAN client opening a website crosses the switch, bridge, routing decision, firewall, NAT, and WAN interface. Inspect each layer with the tool that owns it:

ip route get 1.1.1.1
bridge fdb show br-lan
nft list ruleset | less
tcpdump -ni br-lan host 192.168.1.50
tcpdump -ni wan host 192.168.1.50

If packets appear on ingress but not egress, suspect routing or firewall. If they never appear on ingress, suspect VLAN tags, cabling, port membership, or wireless association.

Wireless is not automatically the LAN

A radio joins a network only when wireless configuration attaches it to one, for example by setting option network 'lan' on a config wifi-iface stanza. That attachment is policy. Later you will intentionally attach different SSIDs to different networks.

Field notes

  • wan is a name, not magic; firewall behavior makes it untrusted.
  • Case labels do not always match Linux port names after target migrations.
  • Bridge loops can take down the entire LAN; do not connect test ports back-to-back.
  • Keep one wired management path whenever changing bridge or switch configuration.
  • Read ip link, bridge link, and /etc/config/network together before changing anything.

Was this lesson helpful?

Sign in to rate