Firewall Scripting Question

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?

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

Edgars

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 :wink:

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
}