IPSEC failover with two ISP

Hi,

We have this test scenario:

On HQ we have Juniper SRX with one ISP, on branch office we have Mikrotik and two ISP (both with dynamic IP).
I did ISP failover settings on Mikrotik - OK.
I created IPSEC vpn in aggressive mode with DPD and it is working - OK.
(source address in peer config is empty and I use user fqdn)
If there is no outgoing communication from office to HQ when ISP1 failovers to ISP2, IPSEC is successfully established over ISP2 - OK.
If there is no outgoing communication from office to HQ when ISP2 failovers to ISP1, IPSEC is again successfully established over ISP1 - OK.

Only problem is when there is some communication (pinging some server in HQ, opening webpage on intranet,…) in the moment of failover.
DPD closes IPSEC vpn correctly (Active peer disappears) but then new Active peer appears but source address is bad - it is IP of non working ISP instead of working ISP.
I think it is due to existing communication and maybe some cache (?) which remembers that this communication should go through IPSEC and through peer with bad source address.

Is it somehow possible to solve this situation to create correct active peer even if there is some communication through IPSEC?
We want to have config as simple as possible and this setup is ideal for us except this problem.

I tried to change tracking settings, IPSEC settings but I wasn’t successful.

Thanks in advance for some idea.

Jakub

Hard to help without seeing your config. Post your IPSec config from:

/ip ipsec
export hide-sensitive

Hi,

Sorry for late response.

IPSEC config:

jul/23/2020 10:43:10 by RouterOS 6.47.1

software id = 5K56-T8T9

model = RBD53GR-5HacD2HnD

serial number = C65F0B11D344

/ip ipsec mode-config
set [ find default=yes ] use-responder-dns=no
/ip ipsec peer
add address=193.179.124.153/32 exchange-mode=aggressive name=peer1 send-initial-contact=no
/ip ipsec profile
set [ find default=yes ] dh-group=modp1024 dpd-interval=5s dpd-maximum-failures=2 enc-algorithm=aes-128 lifetime=8h
/ip ipsec proposal
set [ find default=yes ] auth-algorithms=sha256 enc-algorithms=aes-256-cbc lifetime=1d
/ip ipsec identity
add my-id=user-fqdn:mikrotik@agel.cz peer=peer1
/ip ipsec policy
set 0 disabled=yes
add dst-address=10.1.0.0/22 level=unique peer=peer1 sa-dst-address=193.179.124.153 sa-src-address=0.0.0.0 src-address=192.168.88.0/24 tunnel=yes
add dst-address=10.1.0.0/22 level=unique peer=peer1 sa-dst-address=193.179.124.153 sa-src-address=0.0.0.0 src-address=10.230.0.0/24 tunnel=yes


Jakub