I know there are many similar postings out there, but none of them could solve my issue.
I have to Sites: A and B which are connected via OpenVPN tunnel.
I would like to route a specific subnet of Site A through the OpenVPN Tunnel connected with Site B.
When, at client side, I configure
redirect-gateway def1
then ALL traffic of all subnets get routed through this VPN tunnel.
I am using pfSense at both sites.
I also tried adding following option at client side:
route 192.168.10.0 255.255.255.0
but that does not solve the issue. As soon as I enable redirect-gateway def1
the traffic of the specific subnet gets routed correctly - but all other subnets get routed as well - this should not happen!
What am I doing wrong? I have configured both sites exactly as you can see here: https://docs.netgate.com/pfsense/en/latest/vpn/openvpn/routing-internet-traffic-through-a-site-to-site-openvpn-connection-in-pfsense-2-1.html Basically, it works! But as mentioned I want this routing to work only for one specific subnet!
Any help is highly appreciated!
after hours and days I finally got it working. The key word is "Policy-Based Routing". Basically, you have to define a firewall rule which catches the traffic you want to route and there select the VPN interface as gateway. That's all... It's that easy...
Here's the solution that worked for us: