question about bgp community

Hello,
Is there anyway that implement in our route filter that accept routes from a peer with no tag and with a specific tag in one route filer?
Thanks

Can you be a little more specific?

Do you want to filter by prefix/length with a community and by prefix/length without a community?

Hello,
yes i want to permit a prefix/length with a community and with no community at same time,

I dont think it can be done in one rule, just create an accept rule for the community one, then another for the no community one before your discard rule

yes i know i can do it by 2 rules, but due to high filtering rules i am looking to optimze them

It is not clear to me what you exactly want to achieve and how you got so many rules, but maybe you can make use of the “jump” action to re-use the same ruleset for 2 different conditions.

I.e. in your input filter you setup 2 jump rules for “no community” and “your special community” that both jump to another ruleset that does all your other work.