Hi everyone!
Our customers use many MikroTik gateways. The routers are connected in a star topology with L2TP/IPsec VPN. The main router is L2TP server, the site gateways connect there with L2TP client interface. When the internet connection down for a few minutes (on the site gatways), the L2TP connections are not re-established (if the internet connection is ready again.)
Example:
1. L2TP/IPSec VPN is working between the central (main) router, and the sites routers.
2. Internet connection of a site router will be lost for a few minutes (e.g. site "A") - Usually internet connection problem caused by ISP.
3. Internet connection is UP again.
3. The site router (e.g. site "A") can't reconnect to central (main) router with L2TP/IPsec.
We are see the log:
ISAKMP-SA established XXX.XXX.XXX.XXX[500]-XXX.XXX.XXX.XXX[500] spi:xxxxxxxxxxxxx:xxxxxxxxxxxxx
l2tp-out-company: terminating... - session closed
l2tp-out-company: disconnected
ISAKMP-SA deleted XXX.XXX.XXX.XXX[500]-XXX.XXX.XXX.XXX[500] spi:xxxxxxxxxxxxx:xxxxxxxxxxxxx
ISAKMP-SA established XXX.XXX.XXX.XXX[500]-XXX.XXX.XXX.XXX[500] spi:xxxxxxxxxxxxx:xxxxxxxxxxxxx
l2tp-out-company: terminating... - session closed
l2tp-out-company: disconnected
ISAKMP-SA deleted XXX.XXX.XXX.XXX[500]-XXX.XXX.XXX.XXX[500] spi:xxxxxxxxxxxxx:xxxxxxxxxxxxx
ISAKMP-SA established XXX.XXX.XXX.XXX[500]-XXX.XXX.XXX.XXX[500] spi:xxxxxxxxxxxxx:xxxxxxxxxxxxx
l2tp-out-company: terminating... - session closed
l2tp-out-company: disconnected
ISAKMP-SA deleted XXX.XXX.XXX.XXX[500]-XXX.XXX.XXX.XXX[500] spi:xxxxxxxxxxxxx:xxxxxxxxxxxxx
Sometimes we see the log that, "old tunnel is not closed yet."
When this problem becomes current, we disable the L2TP interface (on the client) for 30 minutes. After enabling the interface, the L2TP VPN will work again. We change to main MikroTik router to Sophos XG, but the problem is same.
MikroTik log:
ISAKMP-SA established XXX.XXX.XXX.XXX[500]-XXX.XXX.XXX.XXX[500] spi:xxxxxxxxxxxxx:xxxxxxxxxxxxx
l2tp-out-company: terminating... - session closed
l2tp-out-company: disconnected
ISAKMP-SA deleted XXX.XXX.XXX.XXX[500]-XXX.XXX.XXX.XXX[500] spi:xxxxxxxxxxxxx:xxxxxxxxxxxxx
Sophos log:
xl2tpd[5827]: control_finish: Peer requested tunnel 4204 twice, ignoring second one.
I was looking for solutions in the MikroTik forum, but I only found one. The "solution" that, I have to write a script, which pings through the WAN interface. If the script can't ping through the WAN interface (e.g. 8.8.8.8), take disable the L2TP-client interface for 30 minutes, after enable again. I cannot accept this solution, there is certainly another option. The error might be caused by a configuration issue.
Can you please help me solve the problem?
Thanks in advance!
Gabor