Hello Alex,
>>>
Well, it will work but not in the way the OP desires. Your solution above will ensure that bogon routes received from Team Cymru wil not get advertised upstream (or somewhere else/anywhere, depending on policy). Whereas the OP needed Team Cymru BGP feed in order to block the incoming bogon routes from own upstreams.
And blockng announce of own routes that fall within bogon prefixes does not require Team Cymru BGP feed.
Automation is the way to go here, shouldn't be difficult as Team Cymru prefixes do not change too often.
>>>
Looks like there was one more similar thread from adgwytc, sometime back...
Actually, I just decoded the policy information from cymru that adgwytc shared above. And how it is expected to work.
=========
from: adgwytc
set policy-options policy-statement cymru-bogons-in term 1 from community CYMRU-bogon-community
set policy-options policy-statement cymru-bogons-in term 1 then community add dont-announce
community dont-announce members <your as here>:<some community that supresses anouncements outside your as>;
community CYMRU-bogon-community members [ no-export xxxxx:888 ];
And this is where the confusion sets in..... this is apparently what we set on our system but I am unsure exactly what it means....
===========
You are right, it will not help to block prefixes received from Upstream. And the policy details shared above does not list the action part, but looking at the scenario, I assume this is RTBH and action will be next-hop discard. So it won't help block those prefixes being received from upstream but drop any traffic received for those prefixes.
Blocking the martian prefixes received from upstream can also be done manually (similar to block own martian pefixes advertisement), as you already mentioned that list is not changed too often.
Automating this part, will require to dynamically update the prefix-list used for receive/advertised prefixes from upstream, based on the feed received from cymru with bogan community.
But with RTBH in place and manual martian list blocking/ advertising will pretty much cover against most odds, lets say a new subnet gets added to martian list. Yes?
Since the martian list doesn't change too often, automation may not be necessary.