I mean: routes that are being advertised by BGP because “redistribute connected” and “redistribute static” options have been enabled, are not being marked “incomplete”, instead they are being marked as “IGP”.
Routes redistributed because they appear in “output-networks” should be marked as “IGP”, routes redistributed because of “redistribute connected,static” should be marked “incomplete”. Since there is no synchronization off option in v7, this complicates matters, as the routes will get redistributed via both mechanisms. I would suggest marking them as ibgp should take priority in that case, otherwise its not possible to reliably detect in a route filter where the route came from.
Contrived example:
I want to redistribute connected routes if they are public IPs, but not private IPs, unless that private IP also appears in bgp-networks.
if (protocol connected,static && bgp-origin incomplete && chain match-private){reject} # don’t redistribute private routes, unless in a “network” statement
/ip/firewall/address-list
add address-172.16.0.0/20 list=bgp-networks
/ip/address
add address-172.16.0.1/24 interface=ether1 network=172.16.0.0
add address-172.17.20.1/24 interface=ether1 network=172.17.20.0
add address-100.64.200.1/24 interface=ether1 network=100.64.200.0
/ip/route
add blackhole dst-address-172.16.0.0/20
doesn’t work because none of the redistributed routes are marked as incomplete.
172.16.0.0/24 gets advertised because of redistribute connected, and marked as igp (should be incomplete)
172.16.0.0/20 gets advertised because of redistribute static and bgp-networks, and should be marked igp (because its from a “network” statement, the static route only existing to support that network statement), but might get marked incomplete because of the static blackhole (if incomplete were working that is)
172.17.20.0/24 gets advertised because of redistribute connected, but is marked as igp instead of incomplete.
100.64.200.0/24 gets advertised because of redistribute connected, but is marked as igp instead of incomplete.
in this example, I only want 172.16.0.0/20 advertised because it appears in bgp-networks, and 100.64.200.0/24 advertised because connected is redistributed and its not private. 172.16.0.0/24 and 172.17.20.0/24 I want to filter out, but the filter doesn’t work because they’re igp instead of incomplete so the filter has no way to tell the difference between a route being advertised because its redistributed, and a route being advertised because its in bgp-networks.
(and because synchronization off is not an option anymore, I also have to have a static route for 172.16.0.0/20, so unless bgp-networks takes precedence over redistribution, or blackhole routes are ignored by redistribution, this would be marked incomplete instead of igp (except, as I’ve said repeatedly, everything is getting marked as igp, no matter what).
To address the second comment, I’m looking at the routing table of the peer router, and it shows all routes coming from the subject router are marked as IGP, none are marked incomplete. On the subject router, /routing/bgp/advertisements/print shows all routes as “origin=0”, which corresponds to IGP.
Typically (other routers and RouterOS V6) the ORIGIN code is interpreted as:
IGP: “network statement” (“Output Network” (bgp-networks) in RouterOS v7 case)
incomplete: “redistributed from connected, static, or another protocol”
It would be nice if redistribution and output network could each have their own separate filters apart from the “Output Filter” and/or a way to directly check if an NLRI appears in “Output Network”. (maybe “protocol network” or something like that) (and either multiple output networks each with its own filter, or a way to attach a separate filter to individual networks, as its currently difficult if you need some networks to have different communities than other networks).