Overview
Describes the available BGP configuration template commands, guiding users in creating, applying, and managing reusable templates for efficient BGP deployments.
BGP configuration templates ensure consistent, scalable, and efficient BGP configuration, especially in large-scale deployments. Templates allow you to define common configurations once and apply them to multiple BGP neighbors, reducing configuration errors, and simplifying ongoing maintenance.
Types of BGP configuration templates
There are three primary template types, each targeting different aspects of configuration:
| Template type | Purpose | Inheritance details |
|---|---|---|
| af-group | Defines address family–specific settings for groups of neighbors (for example, IPv4 or IPv6). | Neighbors inherit these settings by referencing the af-group with the use command. |
| session-group | Intended for address family–independent (global) settings for groups of neighbors. | Neighbors inherit configuration commands from the session-group template with the use command. |
| neighbor-group | Combines both address family–independent and address family–dependent configurations for groups of neighbors. | Neighbors inherit all settings from the neighbor-group, which can also reference af-group and session-group templates for hierarchical inheritance. |
Inheritance behavior
-
When you assign a neighbor to a group with the use command, the neighbor inherits all settings from the group unless you explicitly override a setting at the neighbor level.
-
If you configure a setting directly under a neighbor, it overrides inherited values.
-
Some inherited configuration settings may be hidden if multiple group types are layered.
Configuration examples
Router(config)# router bgp 140
Router(config-bgp)# af-group afmcast1 address-family ipv4 unicast
Router(config-bgp-afgrp)#
session-group:
Router# router bgp 140
Router(config-bgp)# session-group session1
Router(config-bgp-sngrp)#
neighbor-group:
Router(config)# router bgp 123
Router(config-bgp)# neighbor-group nbrgroup1
Router(config-bgp-nbrgrp)#
neighbor-group with address family:
Router(config)# router bgp 140
Router(config-bgp)# neighbor-group nbrgroup1
Router(config-bgp-nbrgrp)# address-family ipv4 unicast
Router(config-bgp-nbrgrp-af)#
Directly configured settings always take precedence over inherited template settings.