Can anyone help me with a script which automatically kills all the connections at the specified time of the day?

Hello, I have four VPN services configured on my MikroTik router out of which three are L2TP and one is IPsec.

I face a problem with the IPsec VPN, as the VPN’s public IP is dynamic (I use DDNS) and hosted on Fortigate Firewall, whenever there is a change in public IP I need to kill the connection so that the traffic passes.

Can anyone help me with a script which automatically kills all the connections at the specified time of the day?
Screenshot 2022-05-29 134221.png

Hi.

If I understand you correctly you just have to write a one-line script that just contains:

/ip/ipsec/active-peers/kill-connections

Just use the sceduler to either run that code directly or to run a script that contains it.

It should be enough.

Probably RouterOS 6.x

/ip ipsec active-peers kill-connections