Table Of Contents
BGP Configuration Using Peer Templates
Prerequisites for BGP Configuration Using Peer Templates
Restrictions for BGP Configuration Using Peer Templates
Information About BGP Configuration Using Peer Templates
Peer Groups and BGP Update Generation
BGP Dynamic Update Peer-Groups
How to Configure BGP Using Peer Templates
Configuring Peer Session Templates
Peer Session Templates Simplify BGP Configuration
Configuring Peer Session Template Inheritance with the inherit peer-session Command
Configuring Peer Session Template Inheritance with the neighbor inherit peer-session Command
Verifying Peer Session Templates
Configuring Peer Policy Templates
Peer Policy Templates Simplify and Improve the Flexibility of BGP Configuration
Configuring Peer Policy Template Inheritance with the inherit peer-policy Command
Configuring Peer Policy Template Inheritance with the neighbor inherit peer-policy Command
Verifying Peer Policy Templates
Configuration Examples for BGP Configuration Using Peer Templates
Peer Session Template Configuration Examples
Peer Session Template Verification Examples
Peer Policy Template Configuration Examples
Peer Policy Template Verification Examples
show ip bgp template peer-session
show ip bgp template peer-policy
BGP Configuration Using Peer Templates
The BGP Configuration Using Peer Templates feature introduces a new mechanism that groups distinct neighbor configurations for Border Gateway Protocol (BGP) neighbors that share common policies. This type of policy configuration has been traditionally configured with BGP peer groups. However, peer groups have certain limitations because peer group configuration is bound to update grouping and specific session characteristics. Configuration templates provide an alternative to peer group configuration and overcome some of the limitations of peer groups.
Feature History for the BGP Configuration Using Peer Templates Feature
Finding Support Information for Platforms and Cisco IOS Software Images
Use Cisco Feature Navigator to find information about platform support and Cisco IOS software image support. Access Cisco Feature Navigator at http://www.cisco.com/go/fn. You must have an account on Cisco.com. If you do not have an account or have forgotten your username or password, click Cancel at the login dialog box and follow the instructions that appear.
Contents
•
Prerequisites for BGP Configuration Using Peer Templates
•
Restrictions for BGP Configuration Using Peer Templates
•
Information About BGP Configuration Using Peer Templates
•
How to Configure BGP Using Peer Templates
•
Configuration Examples for BGP Configuration Using Peer Templates
Prerequisites for BGP Configuration Using Peer Templates
BGP must be configured in your network.
Restrictions for BGP Configuration Using Peer Templates
The following restrictions apply to the BGP Configuration Using Peer Templates feature for this release:
•
A peer policy template can inherit up to seven policy templates, and no more than eight policy templates can be applied to a BGP neighbor or peer.
•
A peer session template can directly inherit only one session template. However, each inherited session template can also inherit one session template. So, a BGP neighbor can directly inherit only one session template and indirectly inherit up to seven additional session templates.
•
A BGP neighbor cannot be configured to work with both peer groups and peer templates. In other words, a BGP neighbor can be configured only to belong to a peer group or to inherit policies from peer templates.
Information About BGP Configuration Using Peer Templates
To configure this feature, you must understand the following concepts:
•
Peer Groups and BGP Update Generation
•
BGP Dynamic Update Peer-Groups
•
Inheritance in Peer Templates
Peer Groups and BGP Update Generation
In previous versions of Cisco IOS software, BGP update messages were grouped based on peer group configurations. This method of grouping neighbors for BGP update message generation reduced the amount of system processing resources needed to scan the routing table. This method, however, had the following limitations:
•
All neighbors that shared the same peer group configuration also had to share the same outbound routing policies.
•
All neighbors had to belong to the same peer group and address family. Neighbors configured in different address-families could not belong to different peer groups.
These limitations existed to balance optimal update generation and replication against peer group configuration. These limitations also caused the network operator to configure smaller peer groups, which reduced the efficiency of update message generation and limited the scalability of neighbor configuration.
BGP Dynamic Update Peer-Groups
The introduction of the BGP Dynamic Update Peer-Groups feature separates peer-group configuration from update group generation. The BGP Dynamic Update Peer-Groups feature introduced an algorithm that dynamically calculates BGP update-group membership based on outbound routing policies. Optimal BGP update message generation occurs automatically and independently. BGP neighbor configuration is no longer restricted by outbound routing policies, and update-groups can belong to different address families.
Even though BGP update message generation has been separated from peer group configuration, peer group configuration still retains the following limitations:
•
A neighbor can belong only to one peer group.
•
Neighbors that belong to different address-families cannot belong to the same peer group.
•
Different sets of policies cannot be grouped and applied to a neighbor.
To address the limitations of peer groups, the BGP Configuration Using Peer Templates feature was introduced along with the BGP Dynamic Update Peer-Groups feature. The BGP Configuration Using Peer Templates feature introduces a new mechanism called the peer template. For more information about the BGP Dynamic Update Peer-Groups feature, refer to the BGP Dynamic Update Peer-Groups document.
Peer Templates
A peer template is a configuration pattern that can be applied to neighbors that share common policies. Peer templates are reusable and support inheritance, which allows the network operator to group and apply distinct neighbor configurations for BGP neighbors that share common policies. Peer templates also allow the network operator to define very complex configuration patterns through the capability of a peer template to inherit a configuration from another peer template.
There are two types of peer templates:
•
Peer session templates are used to group and apply the configuration of general session commands that are common to all address family and Network Layer Reachability Information (NLRI) configuration modes.
•
Peer policy templates are used to group and apply the configuration of commands that are applied within specific address-families and NLRI configuration modes.
Peer templates improve the flexibility and enhance the capability of neighbor configuration. Peer templates also provide an alternative to peer group configuration and overcome some limitations of peer groups. With the configuration of the BGP Configuration Using Peer Templates feature and the support of the BGP Dynamic Update Peer-Groups feature, the network operator no longer needs to configure peer groups in BGP and can benefit from improved configuration flexibility and faster convergence.
Note
Peer groups are still supported. The configuration of the BGP Configuration Using Peer Templates feature does not conflict with or restrict peer group configuration. However, a BGP neighbor cannot be configured to work with both peer groups and peer templates. A BGP neighbor can be configured to belong only to a peer group or to inherit policies from peer templates.
Inheritance in Peer Templates
The inheritance capability is a key component of peer template operation. Inheritance in a peer template is similar to node and tree structures commonly found in general computing, for example, file and directory trees. A peer template can directly or indirectly inherit the configuration from another peer template. The directly inherited peer template represents the tree in the structure. The indirectly inherited peer template represents a node in the tree. Because each node also supports inheritance, branches can be created that apply the configurations of all indirectly inherited peer templates within a chain back to the directly inherited peer template or the source of the tree. This structure eliminates the need to repeat configuration statements that are commonly reapplied to groups of neighbors because common configuration statements can be applied once and then indirectly inherited by peer templates that are applied to neighbor groups with common configurations. Configuration statements that are duplicated separately within a node and a tree are filtered out at the source of the tree by the directly inherited template. A directly inherited template will overwrite any indirectly inherited statements that are duplicated in the directly inherited template.
Inheritance expands the scalability and flexibility of neighbor configuration by allowing you to chain together peer templates configurations to create simple configurations that inherit common configuration statements or complex configurations that apply very specific configuration statements along with common inherited configurations. Specific details about configuring inheritance in peer session templates and peer policy templates are provided in the following sections.
Peer Session Templates
Peer session templates are used to group and apply the configuration of general session commands to groups of neighbors that share common session configuration elements. General session commands that are common for neighbors that are configured in different address families can be configured within the same peer session template. Peer session templates are created and configured in peer session configuration mode. Only general session commands can be configured in a peer session template. The following general session commands are supported by peer session templates:
•
description
•
disable-connected-check
•
ebgp-multihop
•
exit peer-session
•
inherit peer-session
•
local-as
•
password
•
remote-as
•
shutdown
•
timers
•
translate-update
•
update-source
•
version
The BGP Configuration Using Peer Templates feature introduces peer session configuration mode and the following peer session commands:
•
exit peer-session—This command is used to enter session-template configuration mode and to create a peer session template.
•
inherit peer-policy—This command is used to configure a peer session template to inherit a configuration from another peer session template. A peer session template can directly inherit only one peer session template. However, each inherited session template can also contain one inherited template.
•
template peer-policy—This command is used to exit session-template configuration mode and enter router configuration mode.
•
neighbor inherit peer-session—This command is used to send locally configured peer session templates to the specified neighbor. If the locally configured peer session template is configured to inherit configurations from other peer session templates, the specified neighbor will also indirectly inherit these configurations from the other peer session templates. This command sends only general session configuration information.
•
show ip bgp template peer-session—This command is used to display locally configured peer session templates. The output can be filtered to display a specific peer session template. By default, it will display all peer session templates.
General session commands can be configured once in a peer session template and then applied to many neighbors through the direct application of a peer session template or through indirect inheritance from a peer session template. The configuration of peer session templates simplifies the configuration of general session commands that are commonly applied to all neighbors within an autonomous system.
Peer session templates support direct and indirect inheritance. A peer can be configured with only one peer session template at a time, and that peer session template can contain only one indirectly inherited peer session template.
Note
If you attempt to configure more than one inherit statement with a single peer session template, an error message will be displayed.
This behavior allows a BGP neighbor to directly inherit only one session template and indirectly inherit up to seven additional peer session templates. This allows you to apply up to a maximum of eight peer session configurations to a neighbor: the configuration from the directly inherited peer session template and the configurations from up to seven indirectly inherited peer session templates. Inherited peer session configurations are evaluated first and applied starting with the last node in the branch and ending with the directly applied peer session template configuration at the of the source of the tree. The directly applied peer session template will have priority over inherited peer session template configurations. Any configuration statements that are duplicated in inherited peer session templates will be overwritten by the directly applied peer session template. So, if a general session command is reapplied with a different value, the subsequent value will have priority and overwrite the previous value that was configured in the indirectly inherited template. The following examples illustrate the use of this feature.
In the following example, the general session command remote-as 1 is applied in the peer session template named SESSION-TEMPLATE-ONE:
template peer-session SESSION-TEMPLATE-ONeremote-as 1exit peer-sessionAnother peer session template named SESSION-TEMPLATE-TWO is configured to inherit the configuration from SESSION-TEMPLATE-ONE and apply the remote-as 2 command.
template peer-session SESSION-TEMPLATE-TWOremote-as 2inherit peer-session SESSION-TEMPLATE-ONEexit peer-sessionThe template named "session-template-one" is indirectly inherited by the template named "peer-session-two", and the remote-as command is applied in each template but with a different autonomous system number. The remote-as 1 command statement is evaluated first. But, since the remote-as 2 command statement was directly applied in "session-template-two", the command in "session-template-two" will have priority over the command from "session-template-one", and the remote-as 2 command will be applied instead of the remote-as 1 command.
Peer session templates support only general session commands. BGP policy configuration commands that are configured only for a specific address family or NLRI configuration mode are configured with peer policy templates.
Peer Policy Templates
Peer policy templates are used to group and apply the configuration of commands that are applied within specific address-families and NLRI configuration mode. Peer policy templates are created and configured in peer policy configuration mode. BGP policy commands that are configured for specific address-families or NLRI configuration modes are configured in a peer policy template. The following BGP policy commands are supported by peer policy templates:
•
advertisement-interval
•
allowas-in
•
as-override
•
capability
•
default-originate
•
distribute-list
•
dmzlink-bw
•
exit-peer-policy
•
filter-list
•
inherit peer-policy
•
maximum-prefix
•
next-hop-self
•
next-hop-unchanged
•
prefix-list
•
remove-private-as
•
route-map
•
route-reflector-client
•
send-community
•
send-label
•
soft-reconfiguration
•
unsuppress-map
•
weight
The BGP Configuration Using Peer Templates feature introduces peer policy configuration mode and the following peer policy commands:
•
debug ip bgp groups—This command is used to enter policy-template configuration mode and to create a peer policy template.
•
Glossary—This command is used to configure a peer policy template to inherit a configuration from another peer policy template. A peer policy template can indirectly inherit up to seven peer policy template configurations.
•
Glossary—This command is used to exit policy-template configuration mode and enter router configuration mode.
•
neighbor inherit peer-policy—This command is used to send locally configured peer policy templates to the specified neighbor. If the peer policy template is configured to inherit configurations from other peer policy templates, the specified neighbor will also indirectly inherit these configurations from the other peer policy templates. This command sends BGP policy configuration information that is applied for specific address-families and NLRI configuration modes. This command does not support general session information.
•
show ip bgp template peer-policy—This command is used to display locally configured peer policy templates. The output can be filtered to display a specific peer policy template. By default, it will display all peer policy templates.
Peer policy templates are used to configure BGP policy commands that are configured for neighbors that belong to specific address-families and NLRI configuration modes. Like peer session templates, peer policy templates are configured once and then applied to many neighbors through the direct application of a peer policy template or through inheritance from peer policy templates. The configuration of peer policy templates simplifies the configuration of BGP policy commands that are applied to all neighbors within an autonomous system.
Like peer session templates, a peer policy template supports inheritance. However, there are minor differences. A directly applied peer policy template can directly or indirectly inherit configurations from up to seven peer policy templates. So, a total of eight peer policy templates can be applied to a neighbor or neighbor group. Inherited peer policy templates are configured with sequence numbers like route-maps. An inherited peer policy template, like a route-map, is evaluated starting with the inherit statement with the lowest sequence number and ending with the highest sequence number. However, there is a difference; a peer policy template will not fall through like a route-map. Every sequence is evaluated, and if a BGP policy command is reapplied with a different value, it will overwrite any previous value from a lower sequence number.
The following peer policy template configuration examples illustrate this behavior. The examples show the configuration of three peer policy templates named ONE, TWO, and THREE. Each template applies the weight command with a different value, and each subsequent template has a higher sequence number than the previous template.
Peer policy template POLICY-TEMPLATE-ONE is configured with the sequence number 10. It is processed first because it has the lowest sequence number. It applies a weight of 1000.
template peer-policy POLICY-TEMPLATE-ONE 10weight 1000exit peer-policyPeer policy template POLICY-TEMPLATE-TWO is processed second because it has the next highest sequence number. It inherits the configuration from peer policy template POLICY-TEMPLATE-ONE and applies a weight of 1000. However, this template is also configured to apply a weight of 2000. So the value of 2000 will overwrite the value inherited from peer policy template POLICY-TEMPLATE-ONE.
template peer-policy POLICY-TEMPLATE-TWO 20inherit peer-policy POLICY-TEMPLATE-ONEweight 2000exit peer-policyFinally, peer policy template POLICY-TEMPLATE-THREE inherits the configurations from peer policy template ONE and TWO. But because peer policy template POLICY-TEMPLATE-THREE is also configured to apply a weight, the weight of 3000 overwrites the weight value of 2000 that was inherited from peer policy template POLICY-TEMPLATE-TWO.
Template peer-policy POLICY-TEMPLATE-THREE 30inherit peer-policy POLICY-TEMPLATE-TWOweight 3000exit peer-policyThe directly applied peer policy template and the inherit statement with the highest sequence number will always have priority and be applied last. Commands that are reapplied in subsequent peer templates will always overwrite the previous values. This behavior is designed to allow you to apply common policy configurations to large neighbor groups and specific policy configurations only to certain neighbors and neighbor groups without duplicating individual policy configuration commands.
Peer policy templates support only policy configuration commands. BGP policy configuration commands that are configured only for specific address families or NLRI configuration modes are configured with peer policy templates.
How to Configure BGP Using Peer Templates
This section contains the following procedures:
•
Configuring Peer Session Templates
•
Configuring Peer Session Template Inheritance with the inherit peer-session Command
•
Configuring Peer Session Template Inheritance with the neighbor inherit peer-session Command
•
Verifying Peer Session Templates
•
Configuring Peer Policy Templates
•
Configuring Peer Policy Template Inheritance with the inherit peer-policy Command
•
Configuring Peer Policy Template Inheritance with the neighbor inherit peer-policy Command
•
Verifying Peer Policy Templates
Configuring Peer Session Templates
This task creates and configures a peer session template.
Peer Session Templates Simplify BGP Configuration
General session commands can be configured once in a peer session template and then applied to many neighbors through the direct application of a peer session template or through indirect inheritance from peer session templates. The configuration of peer session templates simplifies the configuration of general session commands that are commonly applied to all neighbors within an autonomous system.
Note
The commands in Step 5 and 6 are optional and could be replaced with any supported general session commands.
Restrictions
The following restrictions apply to the peer session templates:
•
A peer session template can directly inherit only one session template, and each inherited session template can also contain one indirectly inherited session template. So, a neighbor or neighbor group can be configured with only one directly applied peer session template and seven additional indirectly inherited peer session templates.
•
A BGP neighbor cannot be configured to work with both peer groups and peer templates. A BGP neighbor can be configured to belong only to a peer group or to only inherit policies from peer templates.
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
router bgp as-number
4.
template peer-session session-template-name
5.
remote-as as-number
6.
timers keepalive-interval hold-time
7.
exit peer-session
DETAILED STEPS
What to Do Next
After the peer session template is created, the configuration of the peer session template can be inherited or applied by another peer session template with the inherit peer-session or neighbor inherit peer-session command.
Configuring Peer Session Template Inheritance with the inherit peer-session Command
This task configures peer session template inheritance with the inherit peer-session command. It creates and configures a peer session template and allows it to inherit a configuration from another peer session template.
Note
The commands in Steps 5 and 6 are optional and could be replaced with any supported general session commands.
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
router bgp as-number
4.
template peer-session session-template-name
5.
description text-string
6.
update-source interface-type interface-number
7.
inherit peer-session session-template-name
8.
exit peer-session
DETAILED STEPS
What to Do Next
After the peer session template is created, the configuration of the peer session template can be inherited or applied by another peer session template with the inherit peer-session or neighbor inherit peer-session command.
Configuring Peer Session Template Inheritance with the neighbor inherit peer-session Command
This task configures a router to send a peer session template to a neighbor to inherit the configuration from the specified peer session template with the neighbor inherit peer-session command. Use the following steps to send a peer session template configuration to a neighbor to inherit:
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
router bgp as-number
4.
neighbor ip-address remote-as as-number
5.
neighbor ip-address inherit peer-session session-template-name
6.
exit
DETAILED STEPS
What to Do Next
After the peer session template is created, the configuration of the peer session template can be inherited or applied by another peer session template with the inherit peer-session or neighbor inherit peer-session command.
Verifying Peer Session Templates
This task verifies the configuration of peer session templates.
SUMMARY STEPS
1.
show ip bgp template peer-session session-template-name
DETAILED STEPS
Configuring Peer Policy Templates
This task creates and configures a peer policy template.
Peer Policy Templates Simplify and Improve the Flexibility of BGP Configuration
Peer policy templates are used to configure BGP policy commands that are configured for neighbors that belong to specific address-families and NLRI configuration modes. Peer policy templates can be configured in address family and NLRI configuration modes. Like peer session templates, peer policy templates are configured once and then applied to many neighbors through the direct application of a peer policy template or through inheritance from peer policy templates. Once the router is in peer policy template mode, you can configure any address family-specific command. The configuration of peer policy templates simplifies and improves the flexibility of BGP configuration. A specific policy can be configured once and referenced many times. Because a peer policy supports up to eight levels of inheritance, very specific and very complex BGP policies can also be created.
Note
The commands in Steps 5 through 8 are optional and could be replaced with any supported BGP policy configuration commands.
Restrictions
The following restrictions apply to the peer policy templates:
•
A peer policy template can directly or indirectly inherit up to eight peer policy templates.
•
A BGP neighbor cannot be configured to work with both peer groups and peer templates. A BGP neighbor can be configured to belong only to a peer group or to only inherit policies from peer templates.
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
router bgp as-number
4.
template peer-policy policy-template-name
5.
send-community [both | extended | standard]
6.
maximum-prefix prefix-limit [threshold] [restart restart-interval | warning-only]
7.
weight weight-value
8.
prefix-list prefix-list-name {in | out}
9.
exit peer-policy
DETAILED STEPS
What to Do Next
After the peer policy template is created, the configuration of the peer policy template can be inherited or applied by another peer policy template with the inherit peer-policy or neighbor inherit peer-policy command.
Configuring Peer Policy Template Inheritance with the inherit peer-policy Command
This task configures peer policy template inheritance with the inherit peer-policy command. It creates and configure a peer policy template and allows it to inherit a configuration from another peer policy template.
Note
The commands in Steps 5 and 6 are optional and could be replaced with any supported BGP policy configuration commands.
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
router bgp as-number
4.
template peer-policy policy-template-name
5.
route-map map-name {in | out}
6.
filter-list as-path-list {in | out}
7.
inherit peer-policy policy-template-name sequence-number
8.
exit peer-policy
DETAILED STEPS
What to Do Next
After the peer session template is created, the configuration of the peer session template can be inherited or applied by another peer session template with the inherit peer-policy or neighbor inherit peer-policy command.
Configuring Peer Policy Template Inheritance with the neighbor inherit peer-policy Command
This task configures a router to send a peer policy template to a neighbor to inherit with the neighbor inherit peer-policy command. Use the following steps to send a peer policy template configuration to a neighbor to inherit:
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
router bgp as-number
4.
neighbor ip-address remote-as as-number
5.
address-family {ipv4 | ipv6 | vpnv4 [multicast | unicast | vrf vrf-name]}
6.
neighbor ip-address inherit peer-policy policy-template-name
7.
exit
DETAILED STEPS
What to Do Next
After the peer policy template is created, the configuration of the peer policy template can be inherited or applied by another peer policy template with the inherit peer-policy or neighbor inherit peer-policy command.
Verifying Peer Policy Templates
This task verifies the configuration of peer policy templates.
SUMMARY STEPS
1.
show ip bgp template peer-policy [policy-template-name]
DETAILED STEPS
Configuration Examples for BGP Configuration Using Peer Templates
This section contains the following peer session and peer policy template configuration and verification examples:
•
Peer Session Template Configuration Examples
•
Peer Session Template Verification Examples
•
Peer Policy Template Configuration Examples
•
Peer Policy Template Verification Examples
Peer Session Template Configuration Examples
The following example creates a peer session template named INTERNAL-BGP in session-template configuration mode:
Router(config)# router bgp 101Router(config-router)# template peer-session INTERNAL-BGPRouter(config-router-stmp)# remote-as 202Router(config-router-stmp)# timers 30 300Router(config-router-stmp)# exit-peer-sessionRouter(config-router)#The following example creates a peer session template named CORE1. This example inherits the configuration of the peer session template named INTERNAL-BGP.
Router(config-router)# template peer-session CORE1Router(config-router-stmp)# description CORE-123Router(config-router-stmp)# update-source loopback 1Router(config-router-stmp)# inherit peer-session INTERNAL-BGPRouter(config-router-stmp)# exit-peer-sessionRouter(config-router)#The following example configures the 172.16.0.1 neighbor to inherit the CORE1 peer session template. The 172.16.0.1 neighbor will aso indirectly inherit the configuration from the peer session template named INTERNAL-BGP. The explicit remote-as statement is required for the neighbor inherit statement to work. If a peering is not configured, the spec

