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.
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
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 summaryOverview 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.XDetailed neighbor state, capabilities, timers, and policy information
ExpectedBGP state: Established, shows neighbor-group inherited from, policy names applied
show bgp ipv4 unicastFull BGP table for IPv4 unicast
ExpectedBest paths marked >, valid *, locally originated i
show bgp ipv4 unicast X.X.X.XDetailed 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-routesRoutes 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 routesRoutes 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 NAMEDisplay the content of a specific RPL route-policy
ExpectedShows the policy body — verify logic matches intent
show rpl route-policy NAME attachpointsShow where a route-policy is applied (which neighbors/address-families)
ExpectedLists BGP neighbors and direction (in/out) where this policy is referenced
show bgp processBGP process information: version, tables, memory usage, scan intervals
ExpectedProcess state: running, shows table versions and prefix counts
show bgp neighbor-group NAMEDisplay 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.XPer-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 allFull BGP debug for a specific neighbor
WarningVery verbose. Always specify neighbor IP. Run 'undebug all' after.
clear bgp X.X.X.X softSoft reset BGP session for a specific neighbor
WarningSafe in production. Hard reset: 'clear bgp X.X.X.X'
show bgp update-groupShow 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
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