Hi, i have a script that enable or disable the packet mangle filtering if traffic is low.
One of my scripts enable a mangle rule that accepts all packets, if i use
“/ip firewall mangle enable numbers=1;” in console, it works correctly but if i use this same command in a script, it enable the mangle number selected + 1 (in this example 2)
Don’t use number indices in scripts. They are for humans only. Set a comment on the mangle rule and find the rule based on that. If the comment is “this one”:
What is that code supposed to do? It doesn’t make any sense as it’s written, and doesn’t do what your initial request was - disable or enable a rule from a script.
Before enable or disable my (accept all) rule i first check if mangle rule is enabled.
If mangle rule is disabled i make another checks and if the traffic in a interface is high i disable this rule and the router start to mark and filter packet.