To create a BGP peer template and enter Peer Template Configuration mode, use the template peer command in Router Configuration mode. A peer template can be configured with parameters that apply to many peers. Neighbors can then be configured to inherit parameters from the peer template. A peer template can include both session parameters and peer policies. Peer policies are configured with an address family configuration mode and apply only to that address family. You can configure up to 32 peer templates. When you make a change to a template, the change is immediately applied to all neighbors that inherit from the template (although policy changes are subject to a three-minute delay).
| Default | No peer templates are configured by default. |
| Format | template peer name |
| Mode | BGP Router Config |
| Parameter | Description |
|---|---|
| name | The name of the template. The name may be no more than 32 characters. |
Example: The following shows an example of the command.
(R1) (Config)# router bgp 65000 (R1) (Config-router)# neighbor 172.20.1.2 remote-as 65001 (R1) (Config-router)# neighbor 172.20.2.2 remote-as 65001 (R1) (Config-router)# template peer AGGR (R1) (Config-rtr-tmplt)# timers 3 9 (R1) (Config-rtr-tmplt)# local-as 65002 no-prepend replace-as (R1) (Config-rtr-tmplt)# address-family ipv4 (R1) (Config-rtr-tmplt-af)# send-community (R1) (Config-rtr-tmplt-af)# route-map RM4-IN in (R1) (Config-rtr-tmplt-af)# route-map RM4-OUT out (R1) (Config-rtr-tmplt-af)# exit (R1) (Config-rtr-tmplt)# address-family ipv6 (R1) (Config-rtr-tmplt-af)# send-community (R1) (Config-rtr-tmplt-af)# route-map RM6-IN in (R1) (Config-rtr-tmplt-af)# route-map RM6-OUT out (R1) (Config-rtr-tmplt-af)# exit (R1) (Config-rtr-tmplt)# address-family l2vpn evpn (R1) (Config-rtr-tmplt-af)# send-community both (R1) (Config-rtr-tmplt-af)# route-map RM-EVPN-OUT out (R1) (Config-rtr-tmplt-af)# route-reflector-client (R1) (Config-rtr-tmplt-af)# maximum-prefix 100 (R1) (Config-rtr-tmplt-af)# exit (R1) (Config-rtr-tmplt)# exit (R1) (Config-router)# neighbor 172.20.1.2 inherit peer AGGR (R1) (Config-router)# neighbor 172.20.2.2 inherit peer AGGR (R1) (Config-router)# address-family ipv6 (R1) (Config-router)# neighbor 172.20.1.2 activate (R1) (Config-router)# neighbor 172.20.2.2 activate