But it doesn’t… it just enables the first peer (number 0) and then the terminal prompt just hangs. The extrange thig is that the same line but replacing enable with disable does work ok!:
Good to know that works… As for 6.2. I switched back to 6.1 because it was too buggy. My guess would be that you found another bug where find only returns the first or something.
I have sent an email tu support about this issue, I’ll post the answer here…
I can’t use 6.1 because it has bugs with IPSec, can’t use v6.0 cause has bug with VRRP, can’t use v5.x because it has problems with Mangle rules and performance with RB1000… I hope that I get a “good” version for me soon, I’m having too many headaches whith Mikrotik lately!!
Hi,
i need to push this thread, because i currently searching for the same solution. Is there any way to disable ipsec peers with a script which looks on the firewall address list.
Background for that is, i detect bad-peers on the firewall and blacklist them. To prefent them to do more bad stuff i wanna disable their ipsec peer until it is localy checked.
It shouldn’t be hard. Just iterate over the peers and then search if they are in the address list. But I don’t have anything off hand to do it. I’d have to write it.
Yeah,
it would be great if you can give me some advice.
My idea was do check the addresslist every second or something like that and look if there is a peer with name blacklist.
There i need to look about the ip range if it is 172.8.10.xxx or 172.8.11.xxx and search with this for the matching ipsec peer/policiy.
Thats the way it should work, but the problem is that i need some help to get there.
Can’t you just use the address list to block the ipsec through the firewall? It would benefit much much more efficient then running a script that frequently.
I use IPSEC on location or when I am in a location with WiFi. I use port knocking to request a certain number of hours 1-8. The IP address I am on is entered in the addresslist to grant me access to port 400+4500.
When I need more tome that I estimated before I just knock again but I have first to disconnect the IPSEC because I am still on a private address. The time will be added to or set if the was no time left.
I can also knock to remove the entry in the addresslist by tuning a scheduled script on a set interval which looks in the to remove addresses.
Thats not really a help for me, because i use side to side tunnel. And if there is a security issue i wanna block this tunnel.
But if there is nothing the tunnel should be up everytime.
Thanks for answer,
my idea is not only to disconnect them, i wanna disable his Profile.
For our Setup its not possible that this happens anytime, only if anybody try to attack the server. The outstanding peer’s normaly should connect everytime and stay up.
So what i had done until now is:
I added Firewall rules to identify them and add the ip-address to the blacklist.
My idea was to read with a script this blacklist and identify the third Oktett from the blacklistet ip. With this Oktett i know the peer policy. My System is configured that those Oktett is alwasy the same, also in the wan ip which establishe the tunnel.