Broken br-lan bringup on current snapshots? [Edit: Found workaround.]

I have a DFrobot CM4 IoT Router that I'm running the latest snapshot on, upgraded over time using sysupgrade from older snapshots.

The device uses the standard RPI4 ethernet and wifi interfaces, and also has a r8169 pci ethernet interface, which is loaded using the r8169 module.

My lan is on the br-lan interface:

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth1'
        list ports 'phy0-ap0'
        option stp '1'
        option bridge_empty '1'

Everything used to come up just fine on a reboot, but now I have to manually add eth1 (the r8169 interface) to the br-lan bridge and run /etc/init.d network restart before br-lan gets the proper setup for my lan.

Did something change recently with the network interface bringup where there is possibly a timing issue?

(I will say that the wifi interface was long broken on my system, but is now working again, so maybe phy0-ap0 now being part of the bridge is a new variable.)

I would note that everything works once I add eth1 to the bridge and restart networking, but if I add those steps to a startup script, that does not fix the issue.

My next step is to convert this to wait for the condition, but is there a better way?

if grep -Fxq up /sys/class/net/eth1/operstate ; then
  brctl addif br-lan eth1
  /etc/init.d/network restart
fi

Remove wifi port from the bridge. It never worked like that.
Wifi connects to the bridge specified in Network/Wireless/Edit AP -> select only ONE of networks, likely LAN.

Hmm. Wifi appears to automatically get added to br-lan?

brctl show br-lan
bridge name     bridge id               STP enabled     interfaces
br-lan          7fff.c6f84fce8703       yes             eth1
                                                        phy0-ap0

in /etc/config/network I do have this:

config wifi-iface 'wifinet0'
        option device 'radio0'
        option mode 'ap'
        option ssid ****
        option encryption 'psk2'
        option key '*****'
        option network 'lan'
        option ieee80211w '1'
        option wpa_disable_eapol_key_retries '1'
        option ocv '0'

So that option network is only set to ONE network.

What actually ended up working, weirdly, was adding ifup lan to the end of my startup script.

Remove wifi from BRIDGE CONFIG

Did that. This is what I see:
in /etc/config/network:

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth1'
        option stp '1'
        option bridge_empty '1'

Yet I still see this:

brctl show br-lan
bridge name     bridge id               STP enabled     interfaces
br-lan          7fff.f6725a2c8b91       yes             eth1
                                                        phy0-ap0

Is there a place where the wifi interface is automatically getting added to the bridge?

I managed to avoid this by shutting down the AP's wifi network entirely... (Which if fine, it was a backup AP for my network...)

Disable stp, it delays new port bringup, network 'lan' in wifi section is enough.

Yes in the wireless section/config you see option network 'lan' this adds the wifi 'device' into whatever bridge the 'lan' 'interface' is assigned to ( usually br-lan by default )

1 Like