Community discussions

MikroTik App
 
timofey
just joined
Topic Author
Posts: 8
Joined: Mon Jun 21, 2021 11:10 am

Ipsec wrong password after router reboot

Sun Jun 27, 2021 9:07 pm

Hello!
I have router in datacenter with one public ip and branch office with router and two ISP.
First ISP directly connected from provider switch to router and second (backup) connected to another router (4g modem) with NAT. On backup ISP router I have redirected ports 500 and 4500 for ipsec.
There is two ip-ip tunnel with ipsec from branch office to dc, each for main and backup isp.
All works fine until I reboot the router. After it backup tunnel working, but main tunnel doesn't and on the router in datacenter i've got error "parsing packet failed possible cause wrong password".
Of course passwords didn't changes. To resolve this I need to disable and then enable ip-ip tunnels on both sides and then it start working.
I wish to know what's wrong with my routers/config.

datacenter router:
name="ipip-branch-main" mtu=auto actual-mtu=1426 local-address=dc_ip remote-address=branch_main_isp_ip dscp=inherit clamp-tcp-mss=yes dont-fragment=no ipsec-secret="password" allow-fast-path=no
name="ipip-branch-backup" mtu=auto actual-mtu=1418 local-address=dc_ip remote-address=branch_backup_ip dscp=inherit clamp-tcp-mss=yes dont-fragment=no ipsec-secret="password" allow-fast-path=no
branch router:
name="ipip-dc-main" mtu=auto actual-mtu=1426 local-address=main_isp_ip remote-address=dc_ip dscp=inherit clamp-tcp-mss=yes dont-fragment=no ipsec-secret="password" allow-fast-path=no
name="ipip-dc-backup" mtu=auto actual-mtu=1418 local-address=192.168.88.10 remote-address=dc_ip dscp=inherit clamp-tcp-mss=yes dont-fragment=no ipsec-secret="password" allow-fast-path=no
Also mangle for second ISP:
chain=input action=mark-connection new-connection-mark=cm_backup_isp passthrough=no in-interface=eth7-WAN2 log=no log-prefix=""
chain=output action=mark-routing new-routing-mark=rm_backup_isp passthrough=yes connection-mark=cm_backup_isp log=no log-prefix=""
and route
dst-address=dc_ip pref-src=192.168.88.10 gateway=192.168.88.1 distance=1 scope=30    target-scope=10 routing-mark=rm_backup_isp
 
Kindis
Member
Member
Posts: 438
Joined: Tue Nov 01, 2011 6:54 pm
Location: Sweden

Re: Ipsec wrong password after router reboot

Mon Jun 28, 2021 9:37 am

Now I can be wrong here but I had a simular issue with GRE tunnels.
The issue is most likely that the endpoint that did not restart have not understood that the router rebooted and this flushed all the SA.
Test to lower the timeout value of the tunnel and also retries so that the tunnel goes down if a restart happens. This should solve the issue, which it did in my case with GRE tunnels.
 
timofey
just joined
Topic Author
Posts: 8
Joined: Mon Jun 21, 2021 11:10 am

Re: Ipsec wrong password after router reboot

Mon Jun 28, 2021 10:44 pm

Test it with DPD values 3/1 - same result

Who is online

Users browsing this forum: Amazon [Bot], ragudelo, Sparky85 and 42 guests