Current situation:
If i want to mangle all traffic from an address list (from “x” address list and to “x” address list) i need to make 2 mangle rules:
/ip firewall mangle
add action=mark-packet chain=postrouting disabled=no new-packet-mark=MYMARK passthrough=yes src-address-list=TEST
add action=mark-packet chain=postrouting disabled=no dst-address-list=TEST new-packet-mark=MYMARK passthrough=yes
translated to a programming language will be something like:
if(packet.src-address-list == 'TEST'){
mark packet
}
if(packet.dst-address-list == 'TEST'){
mark packet
}
Router OS support ‘AND’ operator so this rule:
/ip firewall mangle
add action=mark-packet chain=postrouting disabled=no new-packet-mark=MYMARK passthrough=yes src-address-list=TEST dst-address-list=TEST
translated to a programming language will be something like:
if(packet.src-address-list == 'TEST' && packet.dst-address-list == 'TEST'){
mark packet
}
Also Router OS support ‘NOT’ operator:
/ip firewall mangle
add action=mark-packet chain=postrouting disabled=no new-packet-mark=MYMARK passthrough=yes src-address-list=TEST dst-address-list=!TEST
translated to a programming language will be something like:
if(packet.src-address-list == 'TEST' && packet.dst-address-list != 'TEST'){
mark packet
}
It will be possible that Router OS support ‘OR’ operator? (ie: with a ‘|’) so my first rule can be like:
/ip firewall mangle
add action=mark-packet chain=postrouting disabled=no new-packet-mark=MYMARK passthrough=yes src-address-list=|TEST dst-address-list=|TEST
translated to a programming language will be something like:
if(packet.src-address-list == 'TEST' || packet.dst-address-list == 'TEST'){
mark packet
}
I think this can reduce the number of mangle rules and maybe some precious cpu : )
Tell me what do you think. am i crazy? it’s a good idea?