Community discussions

MikroTik App
 
ashwingorityala
just joined
Topic Author
Posts: 5
Joined: Sun May 29, 2022 12:17 pm

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

Sun May 29, 2022 12:44 pm

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?
You do not have the required permissions to view the files attached to this post.
 
DeJoe
newbie
Posts: 33
Joined: Thu May 31, 2018 4:26 pm

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

Mon May 30, 2022 12:42 am

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.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Can anyone help me with a script which automatically kills all the connections at the specified time of the day?  [SOLVED]

Mon May 30, 2022 1:28 am

Probably RouterOS 6.x
/ip ipsec active-peers kill-connections

Who is online

Users browsing this forum: JDF and 15 guests