Create an IPsec tunnel between 2 Mikrotik routers and dynamic public IPs
In this post we are going to create an IPsec VPN tunnel between two remote sites using Mikrotik routers with dynamic public IPs . By default, Mikrotik does not allow to use FQDN (domain names) to setup an IPsec tunnel, so we are going to create some scripts to update the IPsec configuration whenever the local or remote IPs change. The network layout is as follows: The first thing to take into account is that LAN addresses must be different between Site 1 and Site 2.