I’m having a problem replicating the config I had in v6 where I mark all routes learned with a BGP peer set the routing mark with “tunnel” so I can then create policy rules to route traffic over the tunnels. I cant find anything in the wiki about how you would set the routing-table on a filter script. Its not one of the writeable properties? Filter wizard doesn’t seem to have anything about it. All the little information I’ve read finding this seems to point that its not possible and the memory hogging AI isnt quite picking up on it.
/routing bgp peer
add hold-time=6s in-filter=BGP-IN keepalive-time=2s name=tunnel-isp1
nexthop-choice=force-self remote-address=172.16.1.5 remote-as=65000
tcp-md5-key=*****
add hold-time=6s in-filter=BGP-IN keepalive-time=2s name=tunnel-isp2
nexthop-choice=force-self remote-address=172.16.1.1 remote-as=65000
tcp-md5-key=*****
/routing filter
add action=accept chain=BGP-IN prefix=0.0.0.0 prefix-length=0
set-routing-mark=tunnel
add action=mark-routing chain=prerouting comment=tunnel new-routing-mark=tunnel passthrough=no src address=192.168.10.10
RouterOS v7 syntax:
/routing/filter/rule
add chain=BGP-IN rule="if (dst==0.0.0.0/0) { set routing-mark tunnel; accept; }"
[user@dc-mdf-rt1] /routing/filter/rule> add chain=BGP-IN rule="if (dst==0.0.0.0/0) { set routing-mark tunnel; accept; }"
failure: "[Word {set}, Word {routing-mark}, Word {tunnel}]" - invalid argument
[user@dc-mdf-rt1] /routing/filter/rule>
it returns this error [user@dc-mdf-rt1] /routing/filter/rule> add chain=BGP-IN rule="if (dst==0.0.0.0/0) { set routing-mark tunnel; accept; }" failure: "[Word {set}, Word {routing-mark}, Word {tunnel}]" - invalid argument
[user@dc-mdf-rt1] /routing/filter/rule>
ChatGPT said:
RouterOS v7’s routing filters v2 do not support set routing-mark anymore — routing marks can only be applied in firewall/mangle, not inside BGP filters.
Correct v7 filter rule:
/routing/filter/rule
add chain=BGP-IN rule="if (dst == 0.0.0.0/0) { set table=tunnel; accept; }"
[user@dc-mdf-rt1] /routing/filter/rule> add chain=BGP-IN rule="if (dst==0.0.0.0/0) { set table=tunnel; accept; }"
failure: "[Word {set}, Word {table=tunnel}]" - invalid argument



