Step 1 |
enable
Example:
|
Enables privileged EXEC mode.
- Enter your password if prompted.
|
Step 2 |
configure
terminal
Example:
Device# configure terminal
|
Enters global configuration mode.
|
Step 3 |
router
bgp
autonomous-system-number
Example:
Device(config)# router bgp 45000
|
Enters router configuration mode and creates a BGP routing process.
|
Step 4 |
template
peer-session
session-template-name
Example:
Device(config-router)# template peer-session S1
|
Enters session-template configuration mode and creates a peer session template.
- In this example, a peer session template named S1 is created.
|
Step 5 |
ha-mode
graceful-restart
[disable]
Example:
Device(config-router-stmp)# ha-mode graceful-restart
|
Enables the BGP graceful restart capability and BGP NSF awareness.
- Use the
disable keyword to disable BGP graceful restart capability.
- If you enter this command after the BGP session has been established, you must restart the session in order for the capability to be exchanged with the BGP neighbor.
- In this example, the BGP graceful restart capability is enabled for the peer session template named S1.
|
Step 6 |
exit-peer-session
Example:
Device(config-router-stmp)# exit-peer-session
|
Exits session-template configuration mode and returns to router configuration mode.
|
Step 7 |
template
peer-session
session-template-name
Example:
Device(config-router)# template peer-session S2
|
Enters session-template configuration mode and creates a peer session template.
- In this example, a peer session template named S2 is created.
|
Step 8 |
ha-mode
graceful-restart
[disable]
Example:
Device(config-router-stmp)# ha-mode graceful-restart disable
|
Enables the BGP graceful restart capability and BGP NSF awareness.
- Use the
disable keyword to disable BGP graceful restart capability.
- If you enter this command after the BGP session has been established, you must restart the session in order for the capability to be exchanged with the BGP neighbor.
- In this example, the BGP graceful restart capability is disabled for the peer session template named S2.
|
Step 9 |
exit-peer-session
Example:
Device(config-router-stmp)# exit-peer-session
|
Exits session-template configuration mode and returns to router configuration mode.
|
Step 10 |
bgp
log-neighbor-changes
Example:
Device(config-router)# bgp log-neighbor-changes
|
Enables logging of BGP neighbor status changes (up or down) and neighbor resets.
- Use this command for troubleshooting network connectivity problems and measuring network stability. Unexpected neighbor resets might indicate high error rates or high packet loss in the network and should be investigated.
|
Step 11 |
neighbor
ip-address
remote-as
autonomous-system-number
Example:
Device(config-router)# neighbor 192.168.1.2 remote-as 40000
|
Configures peering with a BGP neighbor in the specified autonomous system.
- In this example, the BGP peer at 192.168.1.2 is an external BGP peer because it has a different autonomous system number from the router where the BGP configuration is being entered (see Step 3).
|
Step 12 |
neighbor
ip-address
inherit
peer-session
session-template-number
Example:
Device(config-router)# neighbor 192.168.1.2 inherit peer-session S1
|
Inherits a peer session template.
- In this example, the peer session template named S1 is inherited, and the neighbor inherits the enabling of BGP graceful restart.
|
Step 13 |
neighbor
ip-address
remote-as
autonomous-system-number
Example:
Device(config-router)# neighbor 192.168.3.2 remote-as 50000
|
Configures peering with a BGP neighbor in the specified autonomous system.
- In this example, the BGP peer at 192.168.3.2 is an external BGP peer because it has a different autonomous system number from the router where the BGP configuration is being entered (see Step 3).
|
Step 14 |
neighbor
ip-address
inherit
peer-session
session-template-number
Example:
Device(config-router)# neighbor 192.168.3.2 inherit peer-session S2
|
Inherits a peer session-template.
- In this example, the peer session template named S2 is inherited, and the neighbor inherits the disabling of BGP graceful restart.
|
Step 15 |
end
Example:
Device(config-router)# end
|
Exits router configuration mode and enters privileged EXEC mode.
|
Step 16 |
show
ip
bgp
template
peer-session
[session-template-number]
Example:
Device# show ip bgp template peer-session
|
(Optional) Displays locally configured peer session templates.
- The output can be filtered to display a single peer policy template by using the
session-template-name argument. This command also supports all standard output modifiers.
|
Step 17 |
show
ip
bgp
neighbors
[ip-address
[received-routes |
routes |
advertised-routes |
paths [regexp] |
dampened-routes |
flap-statistics |
received
prefix-filter |
policy [detail]]]
Example:
Device# show ip bgp neighbors 192.168.1.2
|
(Optional) Displays information about TCP and BGP connections to neighbors.
- “Graceful Restart Capability: advertised” will be displayed for each neighbor that has exchanged graceful restart capabilities with this router.
- In this example, the output is filtered to display information about the BGP peer at 192.168.1.2.
|