Community discussions

MikroTik App
 
3dfx
just joined
Topic Author
Posts: 23
Joined: Sun Sep 15, 2013 6:57 pm
Location: Bulgaria

Route Routerboard's outgoing PPTP client connection

Tue Jan 05, 2021 9:54 pm

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?
 
ak4020
just joined
Posts: 21
Joined: Mon Mar 23, 2020 11:35 am

Re: Route Routerboard's outgoing PPTP client connection

Tue Jan 05, 2021 10:06 pm

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
 
3dfx
just joined
Topic Author
Posts: 23
Joined: Sun Sep 15, 2013 6:57 pm
Location: Bulgaria

Re: Route Routerboard's outgoing PPTP client connection

Tue Jan 05, 2021 10:23 pm

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 :)
 
User avatar
JohnTRIVOLTA
Member Candidate
Member Candidate
Posts: 256
Joined: Sun Dec 25, 2016 2:05 pm
Location: BG/Sofia

Re: Route Routerboard's outgoing PPTP client connection

Tue Jan 05, 2021 10:51 pm

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

Who is online

Users browsing this forum: renes, zhakal and 63 guests