Community discussions

MikroTik App
 
jgeiger
just joined
Topic Author
Posts: 6
Joined: Mon Aug 23, 2004 4:34 pm

Firewall Scripting Question

Tue Feb 08, 2005 10:29 pm

I am trying to mark the flow for all my customers, so I can limit them individually in queue trees. I conjured up a script that I thought would work, but no luck:
:for e from 1 to 254 do={
  /ip firewall mangle add \
    dst-address=(x.x.x. . $e . "/32")\
    in-interface=ether1 action=accept\
    mark-flow=(x.x.x. . $e . "Down")\
    comment="" disabled=no
}
Is there something wrong with the syntax, or am I way off base?
 
edzix
Member
Member
Posts: 333
Joined: Thu Jul 01, 2004 3:01 pm
Location: Latvia

Wed Feb 09, 2005 3:17 pm

semms to be correct. What error messages are you receiving?

Edgars
 
User avatar
[ASM]
Member Candidate
Member Candidate
Posts: 284
Joined: Sun Jun 06, 2004 12:59 am
Location: Sofia, Bulgaria
Contact:

Re: Firewall Scripting Question

Wed Feb 09, 2005 8:10 pm

:for e from 1 to 254 do={
  /ip firewall mangle add \
    dst-address=(x.x.x. . $e . "/32")\
    in-interface=ether1 action=accept\
    mark-flow=(x.x.x. . $e . "Down")\
    comment="" disabled=no
}
Try adding spaces before \

something like:
:for e from 1 to 254 do={
  /ip firewall mangle add \
    dst-address=(x.x.x. . $e . "/32") \
    in-interface=ether1 action=accept \
    mark-flow=(x.x.x. . $e . "Down") \
    comment="" disabled=no
}
or write it on one line ;)
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Firewall Scripting Question

Wed Sep 01, 2021 9:30 pm

Is full of error, correct way:
:for e from=1 to=254 do={
  /ip firewall mangle add dst-address="192.168.1.$e/32" in-interface=ether1 action=mark-packet \
        new-packet-mark="192.168.1.$e_down" comment="auto market" chain=forward disabled=no
}

Who is online

Users browsing this forum: No registered users and 21 guests