Community discussions

MikroTik App
 
cigu666
just joined
Topic Author
Posts: 4
Joined: Fri Jan 12, 2018 9:58 am

How to Recive /ip ipsec policy number=$i searching from comment.

Mon Jul 09, 2018 4:35 pm

Hi i
cant get policy number with command
:foreach i in=[ /ip ipsec policy find where comment="IPsec MAIN"] do [
/ip ipsec policy enable numbers=$i]

when I :put $i for every correct result i get answer like this:

*1000000
*1000001

Can you help me to resolve this problem.
I use it for WAN failover and I have to disable some IPsec Policies and kill remote peers when WAN is changing.
Right now i do this by
/ip ipsec policy disable numbers=1 ,
but when someone change order in Policies, script will not worked correct
 
cigu666
just joined
Topic Author
Posts: 4
Joined: Fri Jan 12, 2018 9:58 am

Re: How to Recive /ip ipsec policy number=$i searching from comment.

Wed Jul 11, 2018 11:37 am

For all who were looking somethng like that

this is what you need
/ip ipsec policy disable numbers=[find where comment="comment" ph2-state=established]

Case Closed

Who is online

Users browsing this forum: JDF and 51 guests