Skip to content

bgp nlri srpolicy

Thomas Mangin edited this page Jun 15, 2026 · 2 revisions

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

SR-Policy NLRI (SAFI 73, RFC 9830) carries Segment Routing policy information over BGP. Ze ships the bgp-nlri-srpolicy plugin for both IPv4 and IPv6 SR-Policy families.

Families

Family Config name AFI / SAFI Encode Decode
IPv4 SR-Policy ipv4/sr-policy 1 / 73 Yes Yes
IPv6 SR-Policy ipv6/sr-policy 2 / 73 Yes Yes

Configuration

Enable SR-Policy as an address family on a peer:

bgp {
    peer controller {
        connection { remote { ip 10.0.0.1; } }
        session {
            asn { local 65000; remote 65100; }
            family {
                ipv4/sr-policy { prefix { maximum 10000; } }
                ipv6/sr-policy { prefix { maximum 10000; } }
            }
        }
    }
}

NLRI format

Each SR-Policy NLRI encodes a Distinguisher (4 bytes), Color (4 bytes), and Endpoint address (4 bytes for IPv4, 16 bytes for IPv6). The NLRI is carried in MP_REACH_NLRI / MP_UNREACH_NLRI attributes.

Tunnel Encapsulation attribute

SR-Policy routes typically carry the Tunnel Encapsulation attribute (type 23, RFC 9012) containing the segment list and binding SID. Ze parses Tunnel Encapsulation TLVs on received updates and preserves them on forwarded updates.

ExaBGP bridge

SR-Policy NLRIs are supported through the ExaBGP bridge (ze exabgp plugin), allowing existing scripts to announce and withdraw SR-Policy routes.

Behaviour

The plugin registers the two SR-Policy families with the NLRI splitter. It decodes incoming SR-Policy NLRIs, makes them available to the RIB and filter chain, and re-encodes them on the egress path. ADD-PATH is supported.

Interactions

Plugin Interaction
bgp-rib Stores SR-Policy routes alongside other families.
bgp-rs Route server forwards SR-Policy NLRIs to clients.
bgp-filter-community Community filters apply to SR-Policy routes.

See also

Adapted from the srpolicy plugin source code and RFC 9830.

Home

About

First Steps

Configuration

Operation

Interfaces

Plugins

Plugin Development

Chaos Testing

Blueprints

Development

Reference

Clone this wiki locally