/ip/route/remove [find where (comment~"api\\.") and !(comment~"2025/01/24 14:30")] OK, the final script (quick and dirty but functional) would be # extract addresses in the list :local AddressList [/ip firewall address-list find comment~"api\\."]; :local ipAddress; :lo...
You can check it easily: make a list based on any noncrucial DNS name and then set local static DNS name with different IP and set the low test TTL for that. Then watch how and when the address list reacts to changes to static entry or disabling it. I have created a DNS name with 3 A RRs and TTL=30...
Seems that the TTL of the dynamic DNS based names is used to feed the list and when it expires the list is refreshed to the actual apiN.example.com viewtopic.php?t=177324
The main question is where the "api*" list come from? It comes from /ip firewall address-list where DNS names like api.mycluster.example , api.mycluster2.example create several dynamic address lists with the api.mycluster.example or api.mycluster2.example in their comment. It happens auto...
Tip no. 2: The list that you prepare should be timebased so when you add an entry to it then you should set timer for the entry for eg. 6 hours if you refresh that list every 6 hours. When you readd the entry during that period you just refresh/reset that timer, if not the entry just vanishes. No n...
Tip no. 1: Use route marking. Make a mangle rule ... Oh no. In fact, I tried to solve my problem first with address-lists + PBR (policy based routing). There are many examples of PBR for Mikrotik in the internet, using the firewall and multiple routing tables. It worked but (!) TCP worked SO slowly...
Basically, yes, but for be more "nice" on the point 2: on foreach cycle at the same time you UPDATE the comment if the rule already exist AND add new rules with :timestamp. This do not delete what already exist (and must be keeped) and do not (temporarly) duplicate rules. I agree that you...
Why would I care to take into account what already exists when I can create a bunch of new routes with the current timestamp (even if they are duplicates of the older routes, it does not seem to cause any harm) and then delete everything with non-current timestamps? This looks much simpler, unless i...
Basically, this boils down to 1. At the start of the script, generate some unique string (e.g. :timestamp ) 2. Add this string to the comments of all the routes generated within this iteration of the script 3. At the end of the script, delete all the routes which do not contain this unique string Do...
Dear Colleagues, I have written a script to add host routes to the IPv4 routing table, please see the complete script below. The problem however is that on each invocation, the script creates duplicate entries in the routing table, and of course it does not delete old entries (which it created when ...