Course contents

Module 5: Scaling and OperationsLesson 5.2 (2 of 7 in this module)32 of 43 in the BGP course

Peer groups and templates

Ten neighbours with the same settings means ten copies of the same lines and ten chances for a typo. Peer groups and templates let you write the settings once and attach neighbours to them.

Advanced · 12 min read

You'll learn to configure a peer group, build peer-session and peer-policy templates, and choose between them.

Repeated configuration is a risk

A route reflector with many clients repeats the same remote-as, update-source and route-reflector-client lines for each one. When one client gets a line the others lack, the problem is hard to spot. Grouping settings fixes both the typing and the consistency.

Templates are written once and inherited by each neighbour
Templates are written once and inherited by each neighbourA peer-session template holds remote-as and update-source. A peer-policy template holds next-hop-self and route-reflector-client. Neighbours 10.255.0.2 and 10.255.0.3 inherit both and add only their own address.Templates, written onceNeighbours inherit themtemplate peer-session IBGP-SESSIONremote-as 64500update-source Loopback0template peer-policy IBGP-POLICYnext-hop-selfroute-reflector-clientneighbor 10.255.0.2inherits bothneighbor 10.255.0.3inherits both

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Change a template and every neighbour that inherits it changes with it. Each neighbour keeps only what is truly its own: the address.
One template applied to many neighbours
One template applied to many neighboursR1 has a peer group or session template called IBGP-CLIENTS. It holds the settings every client shares, such as remote-as, update-source and send-community. The neighbours 10.255.0.2, 10.255.0.3 and 10.255.1.1 are each assigned to it, so a change made once in the template applies to all three.template IBGP-CLIENTSremote-as 64500update-source Loopback0R1route reflectorC110.255.0.2C210.255.0.3C310.255.1.1

On small screens, swipe sideways or focus the diagram and use the arrow keys.

A template removes repeated lines and the mistakes that come with copying them. Settings that differ per neighbour, such as the address, stay on that neighbour.

Peer groups

Repetition against a peer group
Repetition against a peer groupEach neighbour repeats the same lines. A peer group holds them once.WithoutThe same lines onevery neighbourEasy to miss oneWith a peer groupSettings in one placeNeighbours join the groupvs

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Fewer lines mean fewer places to make a mistake.
router bgp 64500 neighbor RR-CLIENTS peer-group neighbor RR-CLIENTS remote-as 64500 neighbor RR-CLIENTS update-source Loopback0 neighbor 10.255.0.2 peer-group RR-CLIENTS neighbor 10.255.0.3 peer-group RR-CLIENTS address-family ipv4 unicast neighbor RR-CLIENTS route-reflector-client neighbor 10.255.0.2 activate neighbor 10.255.0.3 activate

The group holds shared settings. Members get them by name. Each member still needs to be activated in the address family.

Illustrative Cisco IOS XE output written for this lesson, not a router capture
RR#show ip bgp peer-group RR-CLIENTS
BGP peer-group is RR-CLIENTS,  remote AS 64500
  BGP version 4
  Neighbor sessions:
    2 Active, is not multisession capable
  Members:
   10.255.0.2
   10.255.0.3
Check membership before assuming settings were applied. A neighbour missing from the member list did not inherit anything.

Templates: session and policy separated

A peer-session template holds session attributes such as remote AS, update source and timers. A peer-policy template holds address-family policy such as route maps and prefix lists. A neighbour can inherit from one of each, and templates can inherit from other templates.

Two templates, one neighbour
Two templates, one neighbourA session template holds transport settings. A policy template holds route policy.Session templateremote-as, timers,update-sourcePolicy templateroute maps, filters,send-communityNeighbourinherits both

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Separating them lets many neighbours share each part.
router bgp 64500 template peer-session IBGP-SESSION remote-as 64500 update-source Loopback0 exit-peer-session template peer-policy CLIENT-POLICY route-reflector-client next-hop-self exit-peer-policy neighbor 10.255.0.2 inherit peer-session IBGP-SESSION address-family ipv4 unicast neighbor 10.255.0.2 inherit peer-policy CLIENT-POLICY neighbor 10.255.0.2 activate

The same effect as the peer group, with session and policy parts reusable on their own.

Technical reference: Cisco IOS XE BGP configuration guide. Output above is illustrative.

A worked example: three eBGP neighbours, same settings

Three provider routers need the same settings: peer from the loopback, allow a TTL of 2, and send a MED of 100 on routes advertised to them. Written neighbour by neighbour that is three update-source lines, three ebgp-multihop lines and three route-map lines, nine in total, each a chance to miss one. With a group the shared lines are written once.

route-map SET-MED permit 10 set metric 100 ! router bgp 64500 neighbor PROVIDERS peer-group neighbor PROVIDERS update-source Loopback0 neighbor PROVIDERS ebgp-multihop 2 neighbor 10.255.1.1 remote-as 64501 neighbor 10.255.1.1 peer-group PROVIDERS neighbor 10.255.1.2 remote-as 64502 neighbor 10.255.1.2 peer-group PROVIDERS neighbor 10.255.1.3 remote-as 64503 neighbor 10.255.1.3 peer-group PROVIDERS address-family ipv4 unicast neighbor PROVIDERS route-map SET-MED out neighbor 10.255.1.1 activate neighbor 10.255.1.2 activate neighbor 10.255.1.3 activate

R1. The group carries update-source, multihop and the outbound route map. Each neighbour keeps its own remote-as because the three providers are in different ASes. Documentation-style addresses.

Adding a fourth provider is now three lines: its remote-as, its membership and its activation. Changing the MED for all of them is one line on the group.

Update groups: the efficiency lives elsewhere now

Older documentation says peer groups save CPU, because the router builds an UPDATE once and copies it to every member instead of building it for each neighbour. Current IOS XE does this work automatically: it puts neighbours with identical outbound policy into update groups, whether or not you used a peer group. The configuration saving is the reason to use a group today.

Where the saving comes from
Where the saving comes fromConfiguration against processing.Peer groupWrite settings onceFewer mistakesEasy to add membersUpdate groupBuilt automaticallyOne UPDATE copiedNeeds the same policyand

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Check the update groups with show ip bgp update-group. Neighbours with different outbound policy end up in separate groups.
show ip bgp update-group show ip bgp replication

Privileged EXEC mode. The first lists each update group and its members. The second shows how many messages were replicated to members instead of built separately.

Dynamic neighbours

A group can also accept sessions from any address in a range, so you do not configure each one. The router listens for connections from the range and creates the neighbour when one arrives. It is used for large numbers of clients that come and go, such as route-reflector clients or branch sites.

router bgp 64500 neighbor RR-CLIENTS peer-group neighbor RR-CLIENTS remote-as 64500 neighbor RR-CLIENTS update-source Loopback0 bgp listen range 10.255.0.0/24 peer-group RR-CLIENTS bgp listen limit 50

Reflector. Any router in 10.255.0.0/24 that opens a session and presents AS 64500 becomes a member. The limit caps how many dynamic neighbours exist.

Check your understanding

Predict · scenario 1

A neighbour joined a peer group but does not have the group's route-reflector-client setting. What should you check first?

Predict · scenario 2

Which holds route maps and prefix lists in the template approach?

Predict · scenario 3

One member of a group needs a different update-source. What is the clean approach?

FAQ

Can a neighbour override the group setting?
Yes. A setting made directly on the neighbour overrides the same setting inherited from the group or template, which lets you keep one exception without leaving the group.
Why prefer templates to peer groups?
A peer group applies one set of policy to all members and members must share outbound updates. Templates separate session settings from policy, can be stacked with inheritance and are more flexible.
Do peer groups reduce CPU load?
Not on their own on current IOS XE, which forms update groups automatically from neighbours with the same outbound policy. The group mainly saves configuration and mistakes.