Skip to content

BGP Peer Templates

I have came across a lot of BGP configurations where there are lot of the configurations can be optimized. But having said that, this is not always the case when the Network is being built gradually.

Here is a couple of them, called Peer Session Templates and Peer Policy Templates; which we can use in such BGP configuration optimisations, when we…

  1. Design a Network from scratch.
  2. Design with a future overview.

These configurations can be used when it comes to commands which are session specific.

  • description
  • disable-connected-check
  • ebgp-multihop
  • exit peer-session
  • inherit peer-session
  • local-as
  • password
  • remote-as
  • shutdown
  • timers
  • translate-update
  • update-source
  • version

I wouldn’t personally set password on a template, because…

  1. You might want to have a different password for a specific peer because it is controlled by some other Administrative body.
  2. In my opinion, it is best practice to set the password per peer than to have it under a template.

Here is an example configuration from Cisco and also take a look at the Peer Policy Templates which is used under address-family. I would strongly advise you to read through the whole document.

Peer Session Template Configuration Examples

The following example creates a peer session template named INTERNAL-BGP in session-template configuration mode:

Router(config-router)# template peer-session INTERNAL-BGP
Router(config-router-stmp)# remote-as 202
Router(config-router-stmp)# timers 30 300
Router(config-router-stmp)# exit-peer-session
Router(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-stmp)# description CORE-123
Router(config-router-stmp)# update-source loopback 1
Router(config-router-stmp)# inherit peer-session INTERNAL-BGP
Router(config-router-stmp)# exit-peer-session
Router(config-router)#
</code>```

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 specified neighbor will not accept the session template.

```Router(config)# router bgp 101
Router(config-router)# neighbor 172.16.0.1 remote-as 202
Router(config-router)# neighbor 172.16.0.1 inherit peer-session CORE1
Router(config-router)#
comments powered by Disqus