PermitANY
Cisco IOS XRConfig503 downloads

BGP Advanced Configuration — Cisco IOS XR

Generate carrier-grade BGP configurations for Cisco IOS XR (ASR 9000, Cisco 8000, NCS) using RPL route-policies, neighbor-groups, session-groups, and graceful maintenance.

↓ example.txt

What is it?

IOS XR BGP runs on Cisco Service Provider platforms (ASR 9000, Cisco 8000, NCS series) and is purpose-built for carrier-grade scale supporting millions of BGP prefixes (Internet full table). The fundamental architectural difference from IOS/IOS-XE is the Routing Policy Language (RPL): ALL neighbor inbound and outbound policies MUST use 'route-policy' — prefix-lists and community-lists cannot be applied directly to neighbors. RPL policies support if/elseif/else/endif logic, parameterized policies (pass a community or prefix-set as argument), and inline match operations against prefix-sets, community-sets, as-path-sets, and extcommunity-sets. Session-groups provide session-level reuse (remote-as, update-source, timers) and neighbor-groups provide full config reuse (session + policy) — equivalent to NX-OS peer templates but more structured. IOS XR requires 'commit' to activate any staged configuration, which acts as a transactional boundary for safe config changes. IOS XR also supports 'graceful-maintenance' for traffic draining before planned maintenance windows, a feature not available in IOS/IOS-XE.

When to use

  • ·Service provider core and edge routing (AS border routers, Internet exchange points)
  • ·Carrying Internet full routing table (800K+ prefixes) — IOS XR handles this at scale
  • ·When advanced RPL policy logic is needed (conditional matching, parameterized policies)
  • ·MPLS L3VPN PE routers requiring BGP VPNv4/VPNv6 with route distinguishers and targets
  • ·Graceful maintenance scenarios requiring controlled traffic drain before router reload
  • ·Multi-AS backbone designs with confederations and complex policy requirements
  • ·When operational consistency across large teams requires structured, modular policy definitions

When NOT to use

  • ·Enterprise campus deployments — use Cisco IOS/IOS-XE which is simpler to operate
  • ·Data center deployments — use NX-OS which has better EVPN/VXLAN integration
  • ·When operators are unfamiliar with RPL — there is significant learning curve vs IOS route-maps
  • ·Small BGP deployments where neighbor-group/session-group overhead adds complexity

How it compares

vs Cisco IOS BGPIOS XR requires RPL route-policies for all neighbor policies (no direct prefix-list/community-list on neighbors). IOS XR has neighbor-groups vs IOS peer-groups. IOS XR requires 'commit' to activate config. IOS XR has graceful-maintenance; IOS does not.
vs Cisco NX-OS BGPNX-OS uses peer templates (session + policy) and supports route-maps. IOS XR uses session-groups/neighbor-groups and requires RPL. IOS XR is SP-focused (MPLS, Internet scale); NX-OS is DC-focused (EVPN, VXLAN).
vs Juniper Junos BGPBoth IOS XR and Junos are SP-grade. Junos uses 'policy-statement' (similar to RPL) and 'groups' (similar to neighbor-groups). IOS XR's RPL is more powerful for complex conditionals; Junos is often preferred for its configuration hierarchy clarity.

Prerequisites

  • →IOS XR uses two-stage commit — all config is staged and requires 'commit' to activate
  • →Route-policies (RPL) must exist before referencing them in neighbor-groups or neighbors
  • →Prefix-sets, community-sets, as-path-sets defined before referencing in route-policies
  • →For 'ibgp policy out enforce-modifications': required when modifying LOCAL_PREF or NEXT_HOP on iBGP egress (normally prohibited per RFC 4271)
  • →Loopback interfaces up and reachable via IGP before configuring iBGP with loopback update-source
  • →BFD configured on the interface ('bfd minimum-interval X' / 'bfd multiplier N') before enabling bfd fast-detect on BGP neighbors

Config Generator

Required when modifying LOCAL_PREF or NEXT_HOP on iBGP egress — normally prohibited per RFC

Verification commands

show bgp summary

Overview of all BGP neighbors and prefix counts — IOS XR does not use 'ip' prefix

ExpectedState shows numeric prefix count for Established sessions; Idle/Active/Connect indicate issues

show bgp neighbors X.X.X.X

Detailed neighbor state, capabilities, timers, and policy information

ExpectedBGP state: Established, shows neighbor-group inherited from, policy names applied

show bgp ipv4 unicast

Full BGP table for IPv4 unicast

ExpectedBest paths marked >, valid *, locally originated i

show bgp ipv4 unicast X.X.X.X

Detailed path attributes for a specific prefix

ExpectedAll paths with LOCAL_PREF, AS-PATH, NEXT_HOP, MED, origin for best-path analysis

show bgp ipv4 unicast neighbors X.X.X.X advertised-routes

Routes being advertised to neighbor after outbound route-policy

ExpectedPrefix list — compare with 'show bgp ipv4 unicast' to see what policy filtered

show bgp ipv4 unicast neighbors X.X.X.X received routes

Routes received from neighbor after inbound route-policy (accepted routes)

ExpectedRequires no additional config — IOS XR stores all received routes by default

show rpl route-policy NAME

Display the content of a specific RPL route-policy

ExpectedShows the policy body — verify logic matches intent

show rpl route-policy NAME attachpoints

Show where a route-policy is applied (which neighbors/address-families)

ExpectedLists BGP neighbors and direction (in/out) where this policy is referenced

show bgp process

BGP process information: version, tables, memory usage, scan intervals

ExpectedProcess state: running, shows table versions and prefix counts

show bgp neighbor-group NAME

Display neighbor-group configuration and all members inheriting from it

ExpectedShows full group config and list of neighbors using this group

Debug commands

trace bgp update neighbor X.X.X.X

Per-update tracing for a specific neighbor — more targeted than debug

WarningPreferred over debug in IOS XR for per-neighbor update troubleshooting

debug bgp X.X.X.X all

Full BGP debug for a specific neighbor

WarningVery verbose. Always specify neighbor IP. Run 'undebug all' after.

clear bgp X.X.X.X soft

Soft reset BGP session for a specific neighbor

WarningSafe in production. Hard reset: 'clear bgp X.X.X.X'

show bgp update-group

Show BGP update groups — IOS XR groups neighbors with identical outbound policy for update optimization

WarningSafe diagnostic tool — useful for understanding update group membership

Common mistakes & fixes

SymptomConfig applied but not taking effect
CauseIOS XR uses a two-stage commit model — configuration is staged but not active until 'commit' is run
FixRun 'commit' in configuration mode. Use 'show configuration' to see staged but uncommitted changes. Use 'commit best-effort' to apply valid parts even if some fail.
SymptomNeighbor configured but routes not received or sent — 'No policy for this direction'
CauseIOS XR requires explicit route-policy in AND out for every neighbor or neighbor-group address-family — there is no implicit 'pass all' as in IOS
FixCreate a permissive policy ('route-policy PASS-ALL\n pass\nend-policy') and apply it: 'route-policy PASS-ALL in' and 'route-policy PASS-ALL out' under address-family
SymptomiBGP policy not modifying LOCAL_PREF or NEXT_HOP
CauseIOS XR does not allow modifying certain iBGP attributes on egress by default (RFC 4271 compliance)
FixAdd 'ibgp policy out enforce-modifications' under 'router bgp' to permit attribute modification on iBGP egress
SymptomNeighbor not coming up after config change
CauseConfiguration was not committed — IOS XR requires 'commit' to activate
FixRun 'commit' or 'end' followed by reviewing 'show bgp summary'
SymptomCommunity not passed to eBGP neighbor
CauseIOS XR uses 'send-community-ebgp' (not 'send-community') and it is disabled by default
FixUnder neighbor-group or neighbor address-family: 'send-community-ebgp standard' and/or 'send-community-ebgp extended'
SymptomBFD not detecting failures
CauseBFD not configured on the physical interface, or BFD process not running
FixConfigure on interface: 'bfd minimum-interval 300' and 'bfd multiplier 3'. Verify with 'show bfd session' and 'show bfd neighbors'.
SymptomRoute-policy changes not reflected in BGP table
CauseRoute-policy is evaluated at the time updates are received/sent — existing routes use the old policy until refreshed
FixRun 'clear bgp X.X.X.X soft' to re-apply policies to existing routes without tearing down the session

Further learning

Recommended books to go deeper on this topic.

BGP Design and Implementation

Randy Zhang & Micah Bartell · Cisco Press · The practical BGP bible — iBGP, eBGP, policies, communities, design patterns

Internet Routing Architectures

Sam Halabi · Cisco Press · BGP for ISPs and large enterprise — AS path, route reflectors, confederation

Related configs