Configuring BGP Peer Groups
You will often want to apply the same policies to most or all of the peers of a particular BGP speaker. Update policies are usually defined by route maps, filter lists, and distribution lists. You can reduce the configuration effort by defining a peer group made up of these peers.
A peer group is defined relative to a particular BGP speaker. Figure 1-35 shows two peer groups, eastcoast and leftcoast. Each of these peer groups is defined for router Chicago, the hub router. Routers Boston, NY, and Miami have no knowledge of being members of Router Chicago's eastcoast peer group. Similarly, routers SanFran, LA, and SanDiego have no knowledge of being members of router Chicago's leftcoast peer group.
The following commands configure the eastcoast peer group on router Chicago:
host1(config)#router bgp 23host1(config)#route-map wtset permit 10host1(config-route-map)#set weight 25host1(config-route-map)#exithost1(config-router)#neighbor eastcoast peer-grouphost1(config-router)#neighbor eastcoast route-map wtset inhost1(config-router)#neighbor 10.6.6.2 remote-as 12host1(config-router)#neighbor 10.6.6.2 peer-group eastcoasthost1(config-router)#neighbor 10.7.3.2 remote-as 12host1(config-router)#neighbor 10.7.3.2 peer-group eastcoasthost1(config-router)#neighbor 10.4.4.2 remote-as 12host1(config-router)#neighbor 10.4.4.2 peer-group eastcoastThe following commands configure the leftcoast peer group on router Chicago:
host1(config-router)#neighbor leftcoast peer-grouphost1(config-router)#neighbor 10.3.3.2 remote-as 78host1(config-router)#neighbor 10.3.3.2 peer-group leftcoasthost1(config-router)#neighbor 10.3.2.2 remote-as 2143host1(config-router)#neighbor 10.3.2.2 peer-group leftcoasthost1(config-router)#neighbor 10.3.1.2 remote-as 136host1(config-router)#neighbor 10.3.1.2 peer-group leftcoast![]()
neighbor peer-group
- Two versions of this command exist. Use to create a BGP peer group or to configure a BGP neighbor to be a member of a peer group.
- To create a BGP peer group, specify a peerGroupName for the new peer group. Use the no version to remove a peer group.
- To assign members to a peer group, specify an ip-address and a peerGroupName of a BGP neighbor that belongs to this group.
- This command takes effect immediately.
- Use the no version to remove a neighbor from a peer group.
For information on the inheritance of configuration values by peer groups and peers, see Inheritance of Configuration Values earlier in this chapter.