I'm running a VPN client on my Rpi, which has been set up to act as a transparent proxy. However, when I static route to Rpi, connection breaks entirely.
After doing traceroute, I assumed it's due to a different return route where Rpi simply ARPs and send packets back to clients directly instead of going through the router, and set up a NAT rule as band aid.
It worked, but multi NAT probably isn't optimal, so I'm looking for other methods. Perhaps I can move Rpi to a different subnet?
My router is fairly old and has limited processing power so sadly I can't just run everything on it.
A topology diagram that shows how things are connected and from where (and to where) you are running the tests
Your configuration (see below)
And the type of setup you are trying to achieve (i.e. a commercial VPN connection, a road-warrior type VPN, something else)?
Also, when you say "transparent proxy" -- do you mean you've setup a true proxy, or just the function that the VPN serves?
Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it here using the "Preformatted text </> " button:
Remember to redact passwords, MAC addresses and any public IP addresses you may have:
The NAT could be necessary as this traffic could be classified as INVALID.
The Traffic starts running via the main router but return traffic is going directly.
If you allow invalid traffic on the interfaces it might work without NAT.
For this make sure you did not enable DROP invalid traffic and also you have to Allow invalid traffic on the LAN interface under CONNTRACK settings (I am not sure about the latter)
P.S. if you want all traffic to run via the Pi could you not simply add a static route for all traffic with an exception for the Pi's address?
What about using g policy based routing? You can send the vpn bound traffic to the pi (as the gateway) based on the client devices that should use the tunnel.
The PBR package does the same thing as I did, it generates fwmarks and routes. And the last time I checked, it only supports routing to different interfaces.
Iām not a PBR expert, so that may be true (or maybe it has more features now). That said, you could put the pi on another subnet such that you can use PBR via an interface to get to the pi. There is no reason that the pi really needs to be on the same l2 subnet as your client devices.
Another approach could be to make your pi into the main router and then your c6 could be a dumb ap. This will greatly simplify the routing as it will all be handled by a single gateway.
Having different subnets for clients and gateways is what I'm looking into, but I'm having trouble setting it up on LuCI, particularly with dhcp and ipv6 prefixes.
The main thing is to ensure the network isn't completely dependent on a device I'm regularly tinkering with, hence this setup.