I've nearly finished migrating a x86 APU router with Debian to a Banana Pi BPI-R3 with OpenWRT 24.10.5, and am struggling to route LAN traffic (192.168.25.0/24) to hosts behind a switch. The switch is wired to the BPI-R3 via a 192.168.110.1 interface and can be reached by LAN hosts at 192.168.110.2. The hosts my LAN cannot reach are on 192.168.35.0/24, which is part of a VLAN my switch manages.
I can ping the switch and access its web management UI from my LAN, and the switch can ping any host on the 192.168.35.0 network, but my LAN can't reach anything in that same network. This connection previously worked on the APU, and nothing on the switch has changed.
Here's a diagram of my setup:
And my BPI-R3 configurations:
root@bpi-r3-router:~# cat /etc/config/network
# irrelevant blocks removed
config device
option name 'br-wan'
option type 'bridge'
list ports 'eth1'
list ports 'wan'
option ipv6 '0'
config device
option name 'eth1'
option macaddr '<snipped>'
config device
option name 'wan'
option macaddr '<snipped>'
config interface 'wan'
option device 'br-wan'
option proto 'dhcp'
option peerdns '0'
config interface 'wan6'
option device 'br-wan'
option proto 'dhcpv6'
config device
option name 'br-lan'
option type 'bridge'
option ipv6 '0'
list ports 'lan3'
list ports 'lan4'
list ports 'sfp2'
config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '192.168.25.1'
option netmask '255.255.255.0'
option ip6assign '60'
config interface 'switch_basement'
option proto 'static'
option device 'lan2'
option ipaddr '192.168.110.1'
option netmask '255.255.255.0'
config route
option interface 'lan'
option target '192.168.25.0/24'
option gateway '192.168.25.1'
config route
option interface 'switch_basement'
option target '192.168.110.0/24'
option gateway '192.168.110.1'
config route
option target '192.168.35.0/24'
option gateway '192.168.110.1'
option interface 'switch_basement'
config rule
option in 'lan'
option src '192.168.25.0/24'
option ipproto '6'
option out 'switch_basement'
option dest '192.168.35.0/24'
option lookup 'main'
option disabled '1'
root@bpi-r3-router:~# cat /etc/config/firewall
# irrelevant blocks removed
config zone
option name 'lan'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
list network 'lan'
config zone
option name 'wan'
list network 'wan'
list network 'wan6'
option input 'DROP'
option output 'ACCEPT'
option forward 'REJECT'
option masq '1'
option mtu_fix '1'
config zone
option name 'switch_basement'
option input 'REJECT'
option output 'ACCEPT'
option forward 'ACCEPT'
option family 'ipv4'
list network 'switch_basement'
option masq '1'
option log '1'
config forwarding
option src 'lan'
option dest 'wan'
config forwarding
option src 'switch_basement'
option dest 'wan'
config forwarding
option src 'lan'
option dest 'switch_basement'
config nat
option name 'nat-lan-wifi'
option family 'ipv4'
list proto 'all'
option src 'wan'
option src_ip '192.168.25.0/24'
option target 'MASQUERADE'
config nat
option name 'nat-switch-basement'
option family 'ipv4'
list proto 'all'
option src 'wan'
option src_ip '192.168.110.0'
option target 'MASQUERADE'
option device 'lan2'
config nat
option name 'nat-wifi-to-switch-basement'
option family 'ipv4'
option src 'switch_basement'
option src_ip '192.168.25.1'
option dest_ip '192.168.110.1'
option target 'MASQUERADE'
option device 'br-lan'
list proto 'all'
config nat
option name 'nat-wifi-to-basement-servers'
option family 'ipv4'
option src 'switch_basement'
option target 'MASQUERADE'
option device 'lan2'
option dest_ip '192.168.35.0/24'
list proto 'all'
option enabled '0'
config rule
option src 'lan'
option dest 'switch_basement'
option name 'wifi-to-switch-basement'
option direction 'out'
option device 'br-lan'
option family 'ipv4'
list src_ip '192.168.25.1'
list dest_ip '192.168.110.1'
option target 'ACCEPT'
config rule
option src 'lan'
option dest 'switch_basement'
option name 'wifi-to-basement-servers'
option family 'ipv4'
list dest_ip '192.168.35.0/24'
option target 'ACCEPT'
list src_ip '192.168.25.1'
option enabled '0'
root@bpi-r3-router:~# ip route
default via <snipped> dev br-wan src <snipped>
<snipped> dev br-wan scope link src <snipped>
192.168.25.0/24 via 192.168.25.1 dev br-lan
192.168.35.0/24 via 192.168.110.1 dev lan2
192.168.100.0/24 via 192.168.100.1 dev lan1
192.168.110.0/24 via 192.168.110.1 dev lan2
I originally had this route on my APU:
ip route show
...
192.168.35.0/24 via 192.168.110.2 dev enp3s0
But when I try to configure the same route on the BPI-R3, I get this error:
root@bpi-r3-router:~# ip route add 192.168.35.0/24 via 192.168.110.2 dev lan2
ip: RTNETLINK answers: Network unreachable
I can create and modify that same route in LuCI under Network > Routing, but it doesn't show in Status > Routing. The route only appears in Status > Routing when I use 192.168.110.1, which gives these results for ping and traceroute:
PING 192.168.35.2 (192.168.35.2): 56 data bytes
--- 192.168.35.2 ping statistics ---
5 packets transmitted, 0 packets received, 100% packet loss
traceroute to 192.168.35.2 (192.168.35.2), 20 hops max, 46 byte packets
1 *
2 *
3 *
4 192.168.110.1 123.166 ms !H
Sorry for the long post, and thanks in advance for any thoughts and advice.
