Community discussions

MikroTik App
 
amcrs
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 67
Joined: Fri Apr 23, 2021 6:46 am

A basic not question

Thu Sep 05, 2024 12:28 am

Router OS7.15.3:
If I have an interface, named "BridgeLAN"
and a variable, defined as:

:set BridgeLan BridgeLAN

and then want to set an interface in a firewall filter rule with a script as "not BridgeLAN" how do I get the "!" to show up?

out-interface=!$BridgeLan
out-interface=!($BridgeLan)

and as an act of desperation:
out-interface!=$BridgeLan
out-interface"!"$BridgeLan
out-interface!$BridgeLan

don't work (the line shows a red dot for the error for out-interface)

I want the end result to be saved as (obviously) :
... out-interface=!BridgeLAN

I looked through
https://wiki.mikrotik.com/wiki/Manual:S ... #Variables
and
https://wiki.mikrotik.com/wiki/Manual:S ... and_Tricks

and nothing leaped out at me. Do I have to store the value as
:set BridgeLan !BridgeLAN
(which is awkward as I then need another variable, as I'm also using $BridgeLan in other places)
 
amcrs
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 67
Joined: Fri Apr 23, 2021 6:46 am

Re: A basic not question  [SOLVED]

Thu Sep 05, 2024 12:46 am

To answer my own question,

out-interface=("!".$BridgeLan)

Who is online

Users browsing this forum: No registered users and 6 guests