Hi y'all, I'm running OpenWRT 22.03.3 on GL.Inet Convexa-B and my setup is as below:
Basically I have two interfaces (at OpenWRT level) that are corresponding to two subnets:
lan interface with 192.168.1.1/24 network.
lan_vpn interface with 192.168.10.1/24 network.
I have a bunch of devices that connect to this OpenWRT router under lan and they all have internet connection (via wan). Also under lan, I have a Raspberry Pi device (192.168.1.123) that runs a VPN client.
My goal: I would like to route all the traffic from lan_vpn to the Raspberry Pi device -- basically treating the Pi as a gateway.
Things I have tried (and failed):
Via Luci, under Network -> Interfaces, set the "IPv4 Gateway" option of lan_vpn to 192.168.1.123.
Via Luci, under Network -> Routing, create a static route under lan_vpn that specifies 192.168.1.123 as default gateway and 0.0.0.0/0 as target.
Either way, my Raspberry Pi never saw the traffic coming in.
How did I verify the setup
I run tcpdump -i eth0 on the Raspberry Pi device to monitor the traffic (eth0 is the interface on the device that connects to the OpenWRT router). I confirm this is the correct command as I could see the traffic if I ping the Pi from the router. However, I never see incoming traffic if a device under lan_vpn tried to reach out to the internet (e.g. curl <some-external-ip>).
Before I copy-paste my network configurations, I'd like to ask for a pointer first. What would be the best way to achieve my goal? Would using luci be enough or I will need to touch the configuration files directly? Should I continue playing with the routing table or trying some nftables rules?
guessing with firewall you've got to allow forwarding with 'lan_vpn' since that's exactly what you want to do, forward traffic from 192.168.10.0/24 to 192.168.1.0/24