ASK [rule over mangle]

im getting stuck,

/ip route rule
add comment=R4 routing-mark=cus src-address=192.168.4.0/24 table=main
add dst-address=192.168.4.0/24 table=cus

how can i make it work over the Mangle?

/ip firewall mangle
add action=mark-routing chain=prerouting comment=R4 disabled=yes new-routing-mark=main passthrough=yes src-address=192.168.4.0/24
add action=mark-routing chain=prerouting disabled=yes dst-address=192.168.4.0/24 new-routing-mark=cus passthrough=yes routing-mark=main

it doesn’t work, only works if i remove the ip address

What is the requirement and I dont mean in terms of a small snippet of the config.
How many wans, how many lans and what would you like users/devices to be do or not do…

if you want me to post all config that would be a lot of things :slight_smile: Basically is BGP with VRF

i found that route rule are pretty much similar to Mangle, and i’m thinking that i can make it work…
as i said it does work with ip route rule

Sorry, I did not understand from any of your two posts what you want to achieve and what is not working the way you expect.

There is a bit of confusion since the routing-mark and the name of the routing table are the same thing, but the parameters of /ip route rule rows use both routing-mark and table. The reason is probably historical; here, routing-mark is a match condition (same like in mangle rules) and table is an “output parameter” equivalent to new-routing-mark in mangle rules.

So you may or may not assign a routing-mark to a packet as it passes through mangle/prerouting or mangle/output. When the packet later reaches the routing stage, /ip route rule rows come into play; if the packet matches a row here, and the action of that row is lookup (the default one) or lookup-only-in-table, any routing-mark eventually assigned by mangle rules before is superseded by the one specified in the table parameter of that row. The row may match also on routing-mark, so it can be used to translate one routing-mark to another. And it may also be used to prevent a fallback to main if the routing table chosen using mangle rules contains no route to the destination of the packet - this is one of possible uses of action=lookup-only-in-table.