Long story short, I have RouterOS setup as a VPN server for multiple VoIP tennants.
I have a few mangle rules in place which mark the connections to ensure traffic is returned via the same route it originated from.
Sometimes, when a customer experience unstable connectivity the VPN tunnel will drop but a number of connections will remain open with the connection mark (unknown 13).
This causes the extensions on the other end to fail to register when the tunnel comes back up. To resolve, I would have to go and select those connections and remove them. Thereafter the connections would be reestablished with the correct Connection mark and all is well again.
I am fairly novice when it comes to scripting on RouterOS and was looking for some guidance as to writing a script which could periodically check for these stale connections and remove them. Any assistance would be appreciated.