BGP Peer Groups




A BGP peer group, is a group of BGP neighbors with the same update policies. Update policies are usually set by route maps, distribute−lists and filter−lists, etc. Instead of defining the same policies for each separate neighbor, we define a peer group name and we assign these policies to the peer group.

Members of the peer group inherit all of the configuration options of the peer group. Members can also be configured to override these options if these options do not affect outbound updates; you can only override options set on the inbound.

To define a peer group use the following:

neighbor peer−group−name peer−group
In the following example we will see how peer groups are applied to internal and external BGP neighbors.

RTC#
router bgp 300
neighbor internalmap peer−group
neighbor internalmap remote−as 300
neighbor internalmap route−map SETMETRIC out
neighbor internalmap filter−list 1 out
neighbor internalmap filter−list 2 in
neighbor 5.5.5.2 peer−group internalmap
neighbor 6.6.6.2 peer−group internalmap
neighbor 3.3.3.2 peer−group internalmap
neighbor 3.3.3.2 filter−list 3 in
In the above configuration, we have defined a peer group named internalmap and we have defined some policies for that group, such as a route map SETMETRIC to set the metric to 5 and two different filter lists 1 and 2. We have applied the peer group to all internal neighbors RTE, RTF and RTG. We have defined a separate filter−list 3 for neighbor RTE, and this will override filter−list 2 inside the peer group. Note that we could only override options that affect inbound updates.

Now, let us look at how we can use peer groups with external neighbors. In the same diagram we will configure RTC with a peer−group externalmap and we will apply it to external neighbors.
RTC#
router bgp 300
neighbor externalmap peer−group
neighbor externalmap route−map SETMETRIC
neighbor externalmap filter−list 1 out
neighbor externalmap filter−list 2 in
neighbor 2.2.2.2 remote−as 100
neighbor 2.2.2.2 peer−group externalmap
neighbor 4.4.4.2 remote−as 600
neighbor 4.4.4.2 peer−group externalmap
neighbor 1.1.1.2 remote−as 200
neighbor 1.1.1.2 peer−group externalmap
neighbor 1.1.1.2 filter−list 3 in
Note that in the above configs we have defined the remote−as statements outside of the peer group because we have to define different external ASs. Also we did an override for the inbound updates of neighbor 1.1.1.2 by assigning filter−list 3.

0 Comments: