I have local network 192.168.203.0/24
with 2 gateways:
192.168.203.1
- router that gives access to the internet,
192.168.203.5
- OpenWRT which gives access to other private network through OpenVPN.
The idea behind this is to give access to this other private network for all the clients in LAN, without passing the whole traffic to the internet via VPN.
DHCP informs all the clients that the default gateway in this LAN is 192.168.203.5
.
OpenWRT should, based on destination IP address of incoming packets, route them to other private network, or reroute them to 192.168.203.1
otherwise.
OpenVPN is already working properly in OpenWRT.
How to achieve this in OpenWRT? Is it even legal to reroute packets between gateways in this way?