Skip to content

bgp filter community

Thomas Mangin edited this page Apr 11, 2026 · 4 revisions

Pre-Alpha. This page describes behavior that may change.

Community filter plugin for tagging, stripping, and matching communities (standard, large, extended) on ingress and egress.

Category

Policy.

Configuration

plugin {
    external community { use bgp-filter-community; encoder json; }
}

bgp {
    peer customer {
        connection { remote { ip 10.0.0.1; } }
        session    { asn { remote 65001; } }
        filter {
            import [ community:scrub ];
            export [ community:mark-customer ];
        }
    }
}

The external community block is the operator-chosen alias for the bgp-filter-community plugin, and the alias is what appears in filter references as community:<filter-name>. The specific filter names (community:scrub, community:mark-customer, and so on) come from the plugin's own configuration: each named filter is a rule the plugin registers at stage 1 of startup.

Behaviour

The plugin runs as a filter in the peer's filter { import | export } chain. On every UPDATE, it inspects the configured community types and either accepts, rejects, or modifies the route based on the rule.

Three common patterns the plugin supports out of the box:

  • Tag. Add a community to outgoing routes.
  • Strip. Remove specific communities from incoming routes.
  • Match-and-act. Match a community pattern and drop or modify the route.

The plugin writes modifications into the egress ModAccumulator, which is lazy: a route with no community change incurs no copy of the wire bytes.

Interactions

  • Filters are referenced under filter { import | export } using the <plugin>:<filter> syntax. See Route filters.
  • The plugin runs alongside any other filter plugins in the chain.

Source

main/internal/component/bgp/plugins/filter_community/

Home

About

First Steps

Configuration

Operation

Interfaces

Plugins

Plugin Development

Chaos Testing

Blueprints

Development

Reference

Clone this wiki locally