Community discussions

MikroTik App
 
ramirez
Member Candidate
Member Candidate
Topic Author
Posts: 157
Joined: Sun May 12, 2013 9:48 pm

OVPN, mangle rule and IP routes rule.

Tue Jun 30, 2020 12:21 pm

Greetings to all!

I have a connection between A and B (both MT’s) through OVPN and as I need to use locations A’s Internet service on one device in location B (not the whole subnet, just one device e.g. 192.168.40.40) I have created a mangle rule in location B as chain: prerouting => src address 192.168.40.40 => Dst. Address list: ! local subnet => action: mark routing => new routing mark: traffic => passthrough: yes

In location B as well:

In IP ROUTES, I have (1) dst. Address : 0.0.0.0/0 => Gateway: the OVPN link (which is reachable) => Distance 1 => routing mark: traffic.

I have a separate route as (2) dst. Address: 0.0.0.0/0 => Gateway: 192.168.40.x (location B adsl modem) distance 2, for all other devices in local subnet B.

Everything works as expected and device 192.168.40.40 exists to the Internet using location A’s internet service and all other devices through the local adsl modem. The problem is that if my ISP changes my WAN address in location B then rule (1) in IP ROUTES becomes unreachable (gateway becomes unknown) and I have to log on the MT and manually point again to the OVPN gateway and click OK, for the route to become reachable again.

Is there a way that I can have the rule automatically reconnect to that gateway (OVPN link) after an IP address chance from my ISP?

Thank you all.
 
ramirez
Member Candidate
Member Candidate
Topic Author
Posts: 157
Joined: Sun May 12, 2013 9:48 pm

Re: OVPN, mangle rule and IP routes rule.

Wed Jul 01, 2020 6:06 pm

Bump!

Who is online

Users browsing this forum: No registered users and 73 guests