Community discussions

MikroTik App
 
w4rh0und
Member Candidate
Member Candidate
Topic Author
Posts: 107
Joined: Fri Oct 16, 2009 10:58 pm

Routing over IPSEC VPN to remote network

Tue Feb 07, 2017 10:47 pm

Hi everyone,

I have the following scenario:
An IPSEC VPN between a mikrotik CCR1009 and a Fortigate router.

Establishing the VPN is not a problem, but the issue i am encountering is routing a packet from a network behind the Mikrotik to a remote network behind the Fortigate.

Mikrotik -VPN-Fortigate-Router-remote subnet

I can route traffic back and forth between the subnets directly connected to the Mikrotik and the Fortigate, but i do not know how i can route the traffic from behind the mikrotik all the way to the remote network, since there is no interface or ip that i can use to route the packets over.
Do i need to add the remote network in the IPsec policy?

I cannot use IPIP or GRE tunnels since that will cause a really slow link.

Please advise.
 
User avatar
razavim
Trainer
Trainer
Posts: 99
Joined: Sun Sep 27, 2015 1:43 pm
Location: Turkey
Contact:

Re: Routing over IPSEC VPN to remote network

Tue Feb 07, 2017 11:20 pm

so let me clarify. what you want to achieve here is that one subnet behind Mikrotik ise fortigate as a Next hop and vice versa?

Sent from my SM-N910C using Tapatalk
 
Van9018
Long time Member
Long time Member
Posts: 558
Joined: Mon Jun 16, 2014 6:26 pm
Location: Canada - Abbotsford

Re: Routing over IPSEC VPN to remote network

Tue Feb 07, 2017 11:20 pm

You need an IPSec Policy and the policy needs to be in tunnel mode. I believe you also have to create an IP > Firewall > NAT rule
Chain=srcnat, dst-address:<RemoteSubnet/24>, Action=Accept

Follow the red arrows in this diagram
http://wiki.mikrotik.com/wiki/Manual:Pa ... encryption

You can see that the packet destined to the remote network follows the routing rules and it's not until it's about to go out the wan interface that the IPSec Policy kicks in. Because it goes past the post-routing phase, you need the srcnat rule otherwise the masquerade rule will apply and change the src-address of the packet. So the packet destined to the remote network then gets wrapped in an ESP packet (because tunnel mode is selected) and the newly wrapped packet gets dropped back into routing where it gets routed out the wan interface to the destination where it is unwrapped and dropped into the remote routers routing logic.

Hope that makes sense.
 
w4rh0und
Member Candidate
Member Candidate
Topic Author
Posts: 107
Joined: Fri Oct 16, 2009 10:58 pm

Re: Routing over IPSEC VPN to remote network

Thu Feb 09, 2017 9:57 pm

thank you for the answer.

So route from remote to the subnet behind firewall and add a policy for the remote network as well.

Will try it out

Who is online

Users browsing this forum: No registered users and 19 guests