BGP Configuration Guide for Cisco 8000 Series Routers, Cisco IOS XR Releases

PDF

BGP neighbor groups

Want to summarize with AI?

Log in

Overview

Introduces BGP neighbor groups and provides instructions for configuring a BGP neighbor group to simplify neighbor management and streamline configuration tasks.

A BGP neighbor group is a configuration template that:

  • stores address family-independent and address family-dependent settings

  • enables multiple BGP neighbors to inherit shared configuration parameters, and

  • allows centralized management and consistent application of BGP neighbor policies.

Configuration inheritance

After you configure a neighbor group, each BGP neighbor can inherit its configuration by using the use command. By default, a neighbor configured to use a neighbor group inherits all configuration from that group, including address family-independent and address family-dependent settings.

Overriding inherited configuration

You can override inherited settings by directly configuring commands for the neighbor. Alternatively, associate session groups or address family groups with the neighbor using the use command

Configuring address family-independent parameters

Configure address family-independent parameters directly within the neighbor group configuration mode.

Configuring address family-dependent parameters

To configure address family-dependent parameters, enter the address family submode under the neighbor group by using the address-family command.

Assigning options to a neighbor group

After specifying the neighbor group name with the neighbor group command, assign the configuration options you want the group to use. Downstream neighbors inherit these options.

Suppose you have several BGP neighbors that require the same password and update-source configuration. Instead of configuring these parameters for each neighbor individually, define them in a neighbor group and attach the group to each neighbor with the use command.


Configure a BGP neighbor group

Centralize and streamline BGP configuration by creating a BGP neighbor group and applying its settings to BGP neighbors.

BGP neighbor groups let you manage common settings, such as address family, remote AS number, and route policies across multiple BGP neighbors. By grouping neighbors with similar configurations, you can simplify management and reduce configuration errors.

Before you begin

  • Ensure you have administrative access to the command-line interface of the router.

  • Verify that the router supports BGP and is properly licensed.

  • Identify the autonomous system (AS) numbers and IP addresses for both local and remote peers.

  • Prepare any required route policies to apply to the neighbor group.

Follow these steps to configure a BGP neighbor group and apply it to a neighbor:

Procedure

1.

Enter BGP configuration mode and specify the local AS number and address family (such as IPv4 or IPv6 unicast).

Example:

Router# configure
Router(config)# router bgp 120
Router(config-bgp)# address-family ipv4 unicast
Router(config-bgp-af)# exit
2.

Configure a neighbor group by specifying a remote autonomous system (AS) number for that group. Apply the address family, such as IPv4 or IPv6, to the BGP neighbor group. Additionally, you can apply inbound or outbound route policies to that neighbor group.

Example:

Router(config-bgp)# neighbor-group nbr-grp-A
Router(config-bgp-nbrgrp)# remote-as 2002
Router(config-bgp-nbrgrp)# address-family ipv4 unicast
Router(config-bgp-nbrgrp-af)# route-policy drop-as-1234 in
Router(config-bgp-nbrgrp-af)# exit
Router(config-bgp-nbrgrp)# exit
3.

Configure a BGP neighbor to inherit configuration from the specified neighbor group.

Example:

Router(config-bgp)# neighbor 172.168.40.24
Router(config-bgp-nbr)# use neighbor-group nbr-grp-A
Router(config-bgp-nbr)# remote-as 2002
Router(config-bgp-nbr)# commit
The BGP neighbor group is configured, and its settings are successfully applied to the specified neighbor. Any changes to the group are consistently applied to all assigned neighbors for centralized management.

Example

This example illustrates centralized configuration using BGP neighbor groups and route policies:

route-policy pass-all 
  pass
end-policy 
router bgp 109
  address-family ipv4 unicast 
     network 172.16.0.0 255.255.0.0
     network 192.16831.7.0 255.255.0.0
     neighbor 172.16.200.1 
       remote-as 167 
       exit
  address-family ipv4 unicast 
     route-policy pass-all in 
     route-policy pass-out out 
     neighbor 172.26.234.2
       remote-as 109 
       exit
  address-family ipv4 unicast 
     neighbor 172.26.64.19
       remote-as 99 
       exit
  address-family ipv4 unicast 
      route-policy pass-all in 
      route-policy pass-all out

In this example:

  • The BGP router is configured to belong to AS 109.

  • The router advertises two networks, 172.16.0.0 and 192.168.7.0, as originating from AS 109.

  • There are three neighbor routers, two external and one internal:

    • The first and third neighbors use different AS numbers.

    • The second neighbor shares AS 109 and is identified as an internal neighbor.

    • Route policies are applied to inbound and outbound routing updates.

This setup allows the router to share routing information about the two networks with all configured neighbors, while distinguishing between internal and external BGP peers based on the AS number.

What to do next

  • Verify the BGP neighbor and group configuration using show commands (for example, show running-config or show bgp neighbors ) to confirm the correct application of settings.

  • Monitor BGP peer status and logs to ensure neighbor establishment and exchange of routing information.