Hi, I recently setup an IPsec tunnel (site to site) and I have a few questions about the configuration I chose to do so.
The topology is the following:

The “server” side (passive) configuration is as follows:
/ip address
add address=192.168.5.24/27 interface=ether1 network=192.168.5.0
/ip pool
add name=rw-pool ranges=192.168.77.2-192.168.77.254
/ip ipsec mode-config
add address-pool=rw-pool address-prefix-length=32 name=cfg1
/ip dhcp-client
add disabled=no interface=ether1
/ip firewall filter
add action=accept chain=forward connection-state=established,related dst-address=192.168.1.0/24 \
src-address=192.168.5.0/27
add action=accept chain=forward connection-state=established,related dst-address=192.168.5.0/27 src-address=\
192.168.1.0/24
add action=fasttrack-connection chain=forward
/ip firewall nat
add action=accept chain=srcnat dst-address=192.168.1.0/24 src-address=192.168.5.0/27
add action=masquerade chain=srcnat
/ip ipsec peer
add auth-method=rsa-signature certificate=server1 exchange-mode=ike2 generate-policy=port-strict \
mode-config=cfg1 passive=yes
/ip ipsec policy
set 0 disabled=yes
add dst-address=192.168.1.0/24 src-address=192.168.5.0/27 template=yes
/ip route
add distance=1 gateway=192.168.5.2
And client side:
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip neighbor discovery-settings
set discover-interface-list=!dynamic
/ip address
add address=192.168.1.2/24 interface=ether2 network=192.168.1.0
/ip dns
set servers=192.168.1.1
/ip firewall filter
add action=accept chain=forward dst-address=192.168.5.0/27 src-address=192.168.1.0/24
add action=accept chain=forward dst-address=192.168.1.0/24 src-address=192.168.5.0/27
add action=fasttrack-connection chain=forward
/ip firewall nat
add action=accept chain=srcnat dst-address=192.168.5.0/27 src-address=192.168.1.0/24
add action=masquerade chain=srcnat
/ip ipsec peer
add address=***.dyndns.org auth-method=rsa-signature certificate=cert_export_client1.crt_0 exchange-mode=ike2 generate-policy=port-strict \
mode-config=request-only
/ip ipsec policy
set 0 disabled=no
add dst-address=192.168.5.0/27 sa-dst-address=87.202.***.*** sa-src-address=192.168.1.2 src-address=192.168.1.0/24 tunnel=yes
/ip route
add distance=1 gateway=192.168.1.1
/system ntp client
set enabled=yes primary-ntp=194.177.210.54
With this configuration I get connected ok. The client side gets the IP from the server pool and I can ping both internal networks from either side.
My questions are:
-
Are the policies I set correct in terms of encrypted traffic should be as supposed to be, encrypted. According to the wiki, If I don’t set accept rules in firewall for the internal networks at both sides I shouldn’t be able to ping either side. This is not the case. The only thing needed to ping beyond the two ends is the src-nat masquerade. Meaning tunnel traffic is NATed and not just accepted? So, either I am doing something wrong in the config or this is the way it’s supposed to work.
-
I am using dynamic WAN address on both sides. Accroding to the wiki when setting the policies I have to explicitly configure SA-SRC and SA-DST address (real IP addresses) at both sides , in a mirror like config.
The way I did it is
Server side: created a template for the internal networks with SA-SRC and SA-DST with 0.0.0.0 and as SRC-ADDR the Internal subnet of the server and DST-ADDR the internal subnet of the client.
Client side configured a tunnel policy stating the same in mirror fashion about SRC-ADDR and DST-ADDR, but this time I enter as SA-SRC the internal IP of the client (192.168.1.2) and SA-DST the WAN IP of the server. Upon connection I see the DA forming at the server side under my template.
Is the configuration of policies correct? ( I have wrote a script to resolve and update the dyndns of the server not shown above and it work ok) -
Also I am not sure about the forward rules in Firewall concering fasttrack and bypass just followed the wiki for this.
-
Is there anything else I should consider?
Thank you in advanced !