To create a peer template and enter a peer template configuration
mode, use the
template command. To remove a peer template,
use the
no form of this command.
template {peer name | peer-policy name | peer-session name}
no template {peer name | peer-policy name | peer-session name}
Syntax Description
peer
name
|
Specifies the name of the neighbor template.
|
peer-policy
name
|
Specifies the name of the peer-policy template.
|
peer-session
name
|
Specifies the name of the peer-session template.
|
Command Modes
Neighbor address-family configurationRouter bgp configuration
Command History
Release
|
Modification
|
4.0(1)
|
This command was introduced.
|
Peer-Templates
The
template command allows you to enable a set
of predefined attributes that a neighbor inherits.
Note |
A Border Gateway Protocol neighbor cannot be configured to work
with both peer groups and peer templates. A BGP neighbor can be configured to
belong to a peer group or to inherit policies from peer templates only.
|
Peer templates support only general policy commands. BGP policy
configuration commands that are configured only for specific address families
or Network Layer Reachability Information configuration modes are configured
with peer templates.
The peer template combines the peer-session and peer-policy templates
to form a basic neighbor definition. It is not mandatory to use a neighbor
template but you can use it to simplify the BGP configuration.
Peer-policy templates are used to group and apply the configuration
of commands that are applied within specific address families and the NLRI
configuration mode. Peer-policy templates are created and configured in peer
policy configuration mode. BGP policy commands that are configured for specific
address families or NLRI configuration modes are configured in a peer-policy
template. When you enter the peer-policy template configuration mode, the
following commands are available:
- suppress-inactive —Advertises the active
routes to the peer only. See the
suppress-inactive command for additional
information.
- exit —Exits current configuration mode.
- filter-list
name {in
|
out }—Creates the AS-PATH filter list on the
inbound and the outbound BGP routes . To remove the entry, use the
no form of this command.
- in —Applies the access list to
incoming routes.
- out —Applies the access list to
outgoing routes.
- inherit peer-policy policy-name
seq-num —Configures a peer-policy template to
inherit the configuration from another peer-policy template. To remove an
inherited statement from a peer-policy template, use the
no form of this command. Range: 1 to 65535.
Default: No inherit statements are configured.
The sequence number specifies the order in which the peer policy
template is evaluated. Like a route-map sequence number, the lowest sequence
number is evaluated first. Peer policy templates support inheritance and a peer
can directly and indirectly inherit up to seven peer policy templates.
Inherited peer policy templates are configured with sequence numbers like route
maps. When multiple peer-policies are configured under a template, only the
policy with the lowest sequence number is executed. If a BGP policy command is
reapplied with a different value, it will overwrite any previous value from a
lower sequence number.
Note |
A BGP routing process cannot be configured to be a member of a
peer group and to use peer templates for group configurations. You must use one
method or the other. We recommend peer templates because they provide improved
performance and scalability.
|
- maximum-prefix max —Specifies
the maximum number of prefixes from this neighbor. Range: 1 to 300000. Default:
This command is disabled by default. Peering sessions are disabled when the
maximum number of prefixes is exceeded. See the
maximum-prefix command for additional
information.
- next-hop-self —Configures the router as
the next hop for a BGP neighbor or peer group. To disable this feature, use the
no form of this command. Default: Disabled.
- next-hop-third-party —Computes a
third-party next hop if possible.
- no —Negates a command or sets its
defaults.
- prefix-list name
{in |
out }—Specifies the route type to apply the
prefix list. To remove the entry, use the
no form of this command.
- in —Applies the prefix list to
incoming routes.
- out —Applies the prefix list to
outgoing routes.
- route-map name
{in |
out }—Specifies the route map name to apply
the route type to the neighbor.
- in —Applies the route map to incoming
routes.
- out —Applies the route map to outgoing
routes.
- route-reflector-client —Configures the
router as a BGP route reflector and configures the specified neighbor as its
client. To indicate that the neighbor is not a client, use the
no form of this command. Default: There is
no route reflector in the autonomous system.
By default, all internal BGP (iBGP) speakers in an autonomous system
must be fully meshed, and neighbors do not readvertise iBGP learned routes to
neighbors, which prevents a routing information loop. When all the clients are
disabled, the local router is no longer a route reflector.
If you use route reflectors, all iBGP speakers do not need not be
fully meshed. In the route reflector model, an Interior BGP peer is configured
to be a route reflector responsible for passing iBGP learned routes to iBGP
neighbors. This scheme eliminates the need for each router to talk to every
other router.
All the neighbors configured with this command will be members of the
client group and the remaining iBGP peers will be members of the nonclient
group for the local route reflector.
- send-community —Specifies that a community
attribute be sent to a BGP neighbor. To remove the entry, use the
no form of this command.
- soft-reconfiguration —Configures the Cisco
NX-OS software to start storing updates. To not store received updates, use the
no form of this command. Default: Disabled.
Entering this command starts the storage of updates, which is required to do
inbound soft reconfiguration. Outbound BGP soft reconfiguration does not
require inbound soft reconfiguration to be enabled.
To use soft reconfiguration, or soft reset, without preconfiguration,
both BGP peers must support the soft route refresh capability, which is
advertised in the open message sent when the peers establish a TCP session.
Clearing the BGP session using the
soft-reconfiguration command has a negative
effect on network operations and should only be used as a last resort.
To determine whether a BGP router supports this capability, use the
show
ip
bgp
neighbors command. If a router supports the route
refresh capability, the following message is displayed:
Received route refresh capability from peer.
If you specify a BGP peer group by using the peer-group-name
argument, all the members of the peer group will inherit the characteristic
configured with this command.
Similar to peer-session templates, peer-policy templates are
configured once and applied to many neighbors through the direct application of
a peer-policy template or through inheritance from peer-policy templates. The
configuration of peer-policy templates simplifies the configuration of BGP
policy commands that are applied to all neighbors within an autonomous system.
Peer-policy templates support direct and indirect inheritance from up
to eight peer-policy templates. Inherited peer-policy templates are configured
with sequence numbers like route maps. An inherited peer-policy template, like
a route map, is evaluated starting with the inherit statement with the lowest
sequence number and ending with the highest sequence number. However, there is
a difference; a peer-policy template will not fall through like a route map.
Every sequence is evaluated, and if a BGP policy command is reapplied with
different value, it will overwrite any previous value from a lower sequence
number.
Peer-policy templates support only general policy commands. BGP
policy configuration commands that are configured only for specific address
families or NLRI configuration modes are configured with peer-policy templates.
Note |
A BGP neighbor cannot be configured to work with both peer groups
and peer templates. A BGP neighbor can be configured to belong only to a peer
group or to inherit policies from only peer templates.
|
Peer-session templates are used to group and apply the configuration
of general session commands to groups of neighbors that share common session
configuration elements. General session commands that are common for neighbors
that are configured in different address families can be configured within the
same peer-session template. Peer-session templates are created and configured
in peer session configuration mode. Only general session commands can be
configured in a peer-session template.
When you enter the peer-session template configuration mode, the
following commands are available:
- description description —Configures
a description to be displayed by the local or a peer router. You can enter up
to 80 characters including spaces.
- disable-connected-check —Disables
connection verification for eBGP peers no more than one hop away when the eBGP
peer is configured with a loopback interface.
- ebgp-multihop —Accepts and attempts BGP
connections to external peers that reside on networks that are not directly
connected.
Note |
You should enter this command under the guidance of Cisco
technical support staff only.
|
- exit —Exits current configuration mode.
- inherit peer-session session-name —Configures
a peer-session template to inherit the configuration from another peer-session
template. To remove an inherit statement from a peer-session template, use the
no form of this command.
- local-as —Allows you to customize the
autonomous system number for eBGP peer groupings.
- neighbor
inherit
peer-session —Configures a router to send a peer
session template to a neighbor so that the neighbor can inherit the
configuration.
- neighbor
translate-update —Upgrades a router running BGP
in the NLRI format to support multiprotocol BGP.
- password —Enables MD5 authentication on a
TCP connection between two BGP peers. The following configuration tools are
available:
- 0
password —Specifies an unencrypted
neighbor password.
- 3
password —Specifies a 3DES encrypted
neighbor password
- password —Specifies an unencrypted
(cleartext) neighbor password
- remote-private-as —Removes the private AS
number from outbound updates.
- show
ip
bgp
template
peer-policy —Displays the locally configured peer
policy templates.
- show
ip
bgp
template
peer-session —Displays the locally configured
peer session templates.
- shutdown —Disables a neighbor or peer
group.
- timers
keepalive-time —Configures keepalive and hold
timers in seconds. Range: 0 to 3600. Default: 60.
- update-source
{ethernet mod port
|
loopback virtual-interface
|
port-channel
number . sub-interface ]}
—Specifies the source of the BGP session and updates. Range:
virtual-interface is 0 to 1023;
number
is 0 to 4096; (optional); .sub-interface
is 1 to 4093 .
General session commands can be configured once in a peer-session
template and then applied to many neighbors through the direct application of a
peer-session template or through indirect inheritance from a peer-session
template. The configuration of peer-session templates simplify the
configuration of general session commands that are commonly applied to all
neighbors within an autonomous system.
Peer-session templates support direct and indirect inheritance. A
peer can be configured with only one peer-session template at a time, and that
peer-session template can contain only one indirectly inherited peer-session
template. However, each inherited session template can also contain one
indirectly inherited peer-session template. So, only one directly applied
peer-session template and up to seven additional indirectly inherited
peer-session templates can be applied, allowing you to apply up to a maximum of
eight peer session configurations to a neighbor: the configuration from the
directly inherited peer-session template and the configurations from up to
seven indirectly inherited peer-session templates. Inherited peer-session
templates are evaluated first, and the directly applied template will be
evaluated and applied last. So, if a general session command is reapplied with
a different value, the subsequent value will have priority and overwrite the
previous value that was configured in the indirectly inherited template.
Peer-session templates support only general session commands. BGP
policy configuration commands that are configured only for specific address
families or NLRI configuration modes are configured with peer-policy templates.
This command requires the Enterprise Services license.
Examples
This example shows how to create a peer-session template named CORE1.
This example inherits the configuration of the peer-session template named
INTERNAL-BGP.
switch(config-router)# template peer-session CORE1
switch(config-router-stmp)#
This example shows how to create and configure a peer-policy template
named CUSTOMER-A:
switch(config-router)# template peer-policy CUSTOMER-A
switch(config-router-ptmp)# exit
switch(config-router)# route-map SET-COMMUNITY in
switch(config-router)# filter-list 20 in
switch(config-router)# inherit peer-policy PRIMARY-IN 20
switch(config-router)# inherit peer-policy GLOBAL 10
switch(config-router)# exit-peer-policy
switch(config-router)#
This example shows how to configure that the maximum prefixes that
will be accepted from the 192.168.1.1 neighbor is set to 1000:
switch(config)# router bgp 64496
switch(config-router) network 192.168.0.0
switch(config-router)# maximum-prefix 1000
This example shows how to configure that the maximum number of
prefixes that will be accepted from the 192.168.2.2 neighbor is set to 5000.
The router is also configured to display warning messages when 50 percent of
the maximum-prefix limit (2500 prefixes) has been reached.
switch(config)# router bgp 64496
switch(config-router) network 192.168.0.0
switch(config-router)# maximum-prefix 5000 50
This example shows how to configure that the maximum number of
prefixes that will be accepted from the 192.168.3.3 neighbor is set to 2000.
The router is also configured to reestablish a disabled peering session after
30 minutes.
switch(config)# router bgp 64496
switch(config-router) network 192.168.0.0
switch(config-router)# neighbor 192.168.3.3 maximum-prefix 2000 restart 30
This example shows how to configure that the warning messages is
displayed when the maximum-prefix limit (500) for the 192.168.4.4 neighbor is
exceeded:
switch(config)# router bgp 64496
switch(config-router)# network 192.168.0.0
switch(config-router)# maximum-prefix 500 warning-only
This example shows how to force all updates destined for 10.108.1.1
to advertise this router as the next hop:
switch(config)# router bgp 64496
switch(config-router)# next-hop-self
This router configuration mode example shows how to configure the
router belongs to autonomous system 109 and is configured to send the
communities attribute to its neighbor at IP address 172.16.70.23:
switch(config)# router bgp 64496
switch(config-router)# send-community
The address family configuration mode example shows how to configure
that the router belongs to autonomous system 109 send the communities attribute
to its neighbor at IP address 172.16.70.23:
switch(config)# router bgp 64496
switch(config-router)# address-family ipv4 multicast
switch(config-router-af)# send-community
This example shows how to enable inbound soft reconfiguration for the
neighbor 10.108.1.1. All the updates received from this neighbor will be stored
unmodified, regardless of the inbound policy. When inbound soft reconfiguration
is done later, the stored information is used to generate a new set of inbound
updates.
switch(config)# router bgp 64496
switch(config-router)# soft-reconfiguration inbound