BGP Peer Templates

Today we’re diving into BGP peer templates.

Peer templates are an evolution to BGP peer groups and serves to address some of the limitations that BGP peers groups carried.

BGP peer groups were used to reducing the number of configurations on a router with many BGP neighbors. In addition to reducing the routers configuration it also offered performance gains by adding the members of a BGP peer group to an update-group. BGP updates are then performed on the group rather than the individual neighbors.

The limitations to BGP peer groups:

  • All neighbors in a group had to share the same outbound routing policies.
  • All neighbors in a group had to be of the same address family.

The answer to the first limitation came from a feature call ‘BGP Dynamic Update Peer-Groups’

Dynamic update Peer-Groups dynamically assigns neighbors to a BGP update-group that is subject to the same outbound routing policies. This meant that you didn’t need to configure a Peer-Group for performance gains.

To address the second limitation, peer templates were introduced.

Peer Templates as did BGP peers groups were created to simplify the configuration of BGP neighbors but carried more power and less limitations.

There are two types of peer templates:

  • Session templates group and apply configurations statements for the BGP session.
  • Policy templates group policy configurations that can be applied to multiple neighbors.

Here is a basic configuration for both

Configure policy template called ibgp_policy


Configure session template called ibgp_session


Apply templates to IBGP neighbors


Templates support something call inheritance. Inheritance allows one template to inherit characteristics from another template. For instance you could have a high level template that defined BGP keepalives and hold down timers for all of your sessoins.

Here I configure a session template called bgp_top. I then have my ibgp_session inherit bgp_top.


There are some limitations around how many inheritance a template can inherit. It’s unlikely that you run into them unless, say you are a large transient ISP.

That’s all for BGP peer templates.