Hi, I’m new to mikrotik and need some help with an IPSec VPN.
I’ve phase 2 with established connection to the site B (Fortigate) but can’t reach the other site.
I’m required to use following ACLs:
Site B: 10.2.20.27/32
Our Site: 172.34.33.188/29
I’m also required to nat our LAN at origin with the following IP: 172.34.33.189 before sending the traffic through the tunnel.
So far for the IPSec config at our Mikrotik I’ve used for the policies Src-Address: 172.34.33.188/29 and dst-address: 10.2.20.27.
With this config I have established phase 1 and 2 correctly but I’m not sure how to continue with the Firewall/Nat and Filter rules needed for this approach I’m required. As additional information, we have fastback enabled.
Is this rule correct? I’ve tried using both of them, I can see packets hit on your rule but nothing on the accept rule, so I guess my pings are leaving through the wan masquerade and not through the IPSec tunnel.
You want one or the other. Yours is to exclude selected traffic from srcnat. Mine is to change source (to 172.34.33.189) of everything destined to 10.2.20.27, at least that’s how I understand the request (it actually seems a bit weird, to add policy for whole /29 and then accept only single address).
Check IP->IPSec->Active Peers, there are counters that should increase when you’re trying to connect to 10.2.20.27. They also show if anything is coming from there. Or you can log packets with:
Then either the other side is not sending anything, or something blocks it. If you don’t have NAT, it could be your firewall blocking ESP packets, but stateful firewall should also allow them once you send something. If you do have NAT, IPSec should should use UDP encapsulation, and that should work.
Other counters are peer’s rx counters, of they are still zero? ESP packets carry data in tunnel, so if you see incoming ESP packets, I’d expect something showing in peer’s rx counters too.
You can check if there’s perhaps some hint in IPSec logs (/system logging add topics=ipsec), but unfortunately they tend to be not very clear and very long.
They still in zero.
The ESP packets only increase when I try outgoing, I don’t see any incoming ESP, neither any incoming packets on the IPSec>Active Peers tab
Yes, but router clearly gets something, so the question is why it doesn’t like it. Are you absolutely sure that what you got is correct? I mean this:
I tried quick test with non-matching policies where on one side I used smaller remote subnet, than the other side had as local one. I got phase 2, everything looked ok, but when remote side sent packet from source that it thought it can send, but local side didn’t have it as alowed, it behaved exactly as you see it, there were incoming ESP packets, but zero rx for peer.
The Interesting traffic to configure in your firewall must be applied as indicated below:
-The network segment 172.34.33.188/29 as your “local address” of the IPSec VPN
-The IP address 10.2.20.27/32 as the “remote address” of the IPSec VPN
Important:
By internal policy, to avoid incurring private IP overlaps:
“It is not allowed to use in the IPSec tunnel the addressing corresponding to your LAN network”
NAT
As described above, you must use the following IP 172.34.33.189 (first available host of the previous network), to perform a “NAT at the origin” of your LAN network and then send the traffic through the IPSec VPN
I don’t know. I still don’t understand why there’s /29 when you should use only one address (with NAT), but otherwise I understand it the same way, i.e. that you should have policy for 172.34.33.188/29 ↔ 10.2.20.27/32. For the lack of better ideas, as a test I’d try to use 10.0.0.0/8 for the remote side, to see if it changes anything for incoming ESP packets and peer’s rx. Or you can try to export and post your config, if perhaps some mistake is there, but I’m not sure what it could be.
Disable the FastTrack rule, that should probably help, because FastTrack and IPSec are not compatible. But I’m not sure if it breaks in exactly this way.