Page 1 of 1

Route Routerboard's outgoing PPTP client connection

Posted: Tue Jan 05, 2021 9:54 pm
by 3dfx
Hello everyone!
I have a Routerboard with two independent, masqueraded WAN connections - main and backup. I would like to set up a PPTP Client interface, but to route it through the backup WAN despite of the primary WAN availability.
Which would be the most elegant way to do that?

Re: Route Routerboard's outgoing PPTP client connection

Posted: Tue Jan 05, 2021 10:06 pm
by ak4020
hi, the problem has been heard before: viewtopic.php?t=75198 I myself would create a route for the target server and that should just work
cheers alois

Re: Route Routerboard's outgoing PPTP client connection

Posted: Tue Jan 05, 2021 10:23 pm
by 3dfx
Thank you for your feedback ak4020!

In fact I was able to route the PPTP client to my backup WAN by placing a static route to the IP address, but that creates a couple of issues;
1. When the PPTP server is a hostname with a dynamic IP, the static route makes any sense only until the IP address of the server changes;
2. All outgoing traffic between the Routerboard and the PPTP server goes through the backup WAN and not only the PPTP tunnel which is what I would like to achieve;
3. If a client, that has the same public IP as the PPTP Server, tries to reach our Routerboard through the Internet and not through the tunnel, the connection fails since our Routerboard replies via the backup WAN...

I managed to overcome point 3 with a couple of quite ugly mangle rules, but I cannot figure out a solution for points 1 and 2.
Therefor I am asking for a more clever solution :)

Re: Route Routerboard's outgoing PPTP client connection

Posted: Tue Jan 05, 2021 10:51 pm
by JohnTRIVOLTA
Hello everyone!
I have a Routerboard with two independent, masqueraded WAN connections - main and backup. I would like to set up a PPTP Client interface, but to route it through the backup WAN despite of the primary WAN availability.
Which would be the most elegant way to do that?
Try this:
1. add routing table with route to last resort:
/ip route add gateway=ip_gatway_wan2 routing-mark=wan2
2.Add bridge and set ip address for pptp server / bridge-pptp /
3.On pptp profile select this bridge
4. Add route rule this network to learn the wan2 routing table:
/ip route rule add src-address=pptp network interface=bridge-pptp action=lookup table=wan2
5.Add snat for pptp network to be nated with wan2 ip address:
/ip firewall nat add chain=srcnat src-address=pptp network out-interface=wan2 action=masquerade