r/openwrt • • 13d ago

Having trouble with network config changes not applying properly - moving ports to another bridge via luci disables them?

As per title, I'm having difficulties with openwrt/luci not applying config changes properly :-

I configured a second bridge via LUCI and added WiFi APs and some LAN ports to it, but openwrt doesn't bring the LAN ports up or add them to the bridge after applying changes or rebooting - I have to ssh in and do that manually each time.

It also doesn't apply the gateway setting to the bridge's routing table and I have to do that manually too.

I've poked around in /etc/config/network but I didn't spot any obvious (to me) issues :-

root@OpenWrt:~# cat /etc/config/network
# [… irrelevant entries trimmed …]

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

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ip6assign '60'
        option multipath 'off'
        list ipaddr '192.168.4.1/24'

# [… br-lan and lan1 work fine …]

config interface 'vpn'
        option proto 'static'
        option ipaddr '192.168.5.1'
        option netmask '255.255.255.0'
        option multipath 'off'
        option gateway '192.168.4.112'
        option ip4table 'vpn2lan'
        option type 'bridge'
        list dns '192.168.4.112'
        option device 'br-vpn'

config route
        option interface 'vpn'
        option target '0.0.0.0/0'
        option gateway '192.168.4.112'
        option table 'vpn2lan'

# [… default gateway is not added to vpn2lan table …]

config rule
        option in 'vpn'
        option lookup 'vpn2lan'

config device
        option type 'bridge'
        option name 'br-vpn'
        option bridge_empty '1'
        option ipv6 '0'
        list ports 'lan2'
        list ports 'lan3'
        list ports 'lan4'
        list ports 'lan5'

# [… lan2-5 are not brought up, and not added to br-vpn …]

(config generated by luci web interface, I haven't edited it manually)

and I can't find those LAN ports mentioned anywhere else in /etc other than the board definition/BSP :-

root@OpenWrt:~# grep -R 'lan[15]' /etc 2>/dev/null | grep -v board
/etc/config/network:    list ports 'lan1'
/etc/config/network:    list ports 'lan5'

After router reboot or applying any configuration changes, I need to manually ssh in and brctl addif br-vpn lan2..5; ip link set lan2..5 up; ip route add table vpn2lan default via 192.168.4.112 because openwrt's systems apparently don't do these steps even though as far as I can tell they should.

I'm familiar with linux networking in general (hence ability to manually fix misconfigurations), but not with how OpenWRT goes about doing things (thus unable to make the changes actually stick and be applied properly)

Where else should I be checking for relevant settings?
Is there somewhere I can temporarily put the commands to fix things that'll automatically get run after network config changes while poking at openwrt's system to do it properly?

Am I encountering some sort of bug here? It seems odd that moving ports to another bridge via web interface disables them, and there's no option in luci web interface to re-enable them…

Are any of these issues fixed in 25.12.6, making an upgrade likely to fix stuff? I didn't see anything relevant in the release notes or changelog

Model: GL.iNet GL-MT6000 Firmware Version: OpenWrt 25.12.5 r33051-f5dae5ece4 / LuCI (HEAD detached at 128a7812) branch 26.180.75667~128a781

2 Upvotes

3 comments sorted by

1

u/ananas7777 12d ago

Two things jump out in your config.

  1. The 'vpn' interface has option type 'bridge' as well as option device 'br-vpn'. That's the old pre-21.02 style. In the new syntax the bridge lives only in the config device section and the interface just points at it. I'd delete that line from the interface. LuCI also wants the config in the new style before it will edit it properly.
  2. The gateway 192.168.4.112 is on br-lan's subnet (192.168.4.0/24), not on vpn's (192.168.5.0/24). A route via the vpn interface to a gateway that isn't on that link gets rejected by the kernel, so the default route never lands in vpn2lan. Drop option gateway from the vpn interface and put the route on lan instead:

    config route option interface 'lan' option target '0.0.0.0/0' option gateway '192.168.4.112' option table 'vpn2lan'

Your config rule with in 'vpn' can stay as it is. Then service network restart and check logread | grep netifd. If lan2-lan5 still don't join br-vpn, make sure they aren't also listed in br-lan in the part you trimmed.

1

u/triffid_hunter 12d ago

The 'vpn' interface has option type 'bridge' as well as option device 'br-vpn'. That's the old pre-21.02 style.

How strange, why's a fresh 25.12.5 install's luci setting it up that way?

As for the rest of your suggestions, so far so good although I haven't tried a full reboot yet - thanks for the tips!

If lan2-lan5 still don't join br-vpn, make sure they aren't also listed in br-lan in the part you trimmed.

I wouldn't trim stuff like that while asking this sort of question; I only omitted wan, wireless, localhost stuff.

1

u/highinthemountains 12d ago

I tried to configure a vlan on one of my bridged Ethernet interfaces and luci wouldn’t store the config. I’m still scratching my head on it because I’m not comfortable doing the command line thing get it configured