Community discussions

just joined
Topic Author
Posts: 1
Joined: Wed Jul 17, 2019 8:58 pm

Interface Scripts

Wed Jul 17, 2019 9:37 pm


I have a task to solve, but i can't write scripts.

Task is very simple. When somebody establishes a VPN connection i have to create a mangle rulr and puge the rule on termination.

I wrote a script to assigne the mangle rule, and it works fine.
It is the "On UP:" script.

/ip firewall mangle add action=mark-routing chain=prerouting disabled=yes comment="$interface teszt for connection" in-interface=$interface

It is just a test line of course not the complete rule.
on termination i shuld run something like this
It is the "on Down:" script:

/ip firewall mangle remove numbers=[:find "$[/ip firewall mangle find]" "$[/ip firewall mangle find where in-interface="$interface"]" -1];

but i can not get it to work.

RouterOs v6.45.1

Can somebody help me please.


Who is online

Users browsing this forum: No registered users and 7 guests