- Table of Contents
-
- 06-Layer 3—IP Routing Command Reference
- 00-Preface
- 01-Basic IP routing commands
- 02-Static routing commands
- 03-OSPF commands
- 04-IS-IS commands
- 05-Basic BGP commands
- 06-Advanced BGP commands
- 07-Policy-based routing commands
- 08-IPv6 static routing commands
- 09-OSPFv3 commands
- 10-IPv6 policy-based routing commands
- 11-Routing policy commands
- 12-DCN commands
- Related Documents
-
Title | Size | Download |
---|---|---|
06-Advanced BGP commands | 280.42 KB |
Contents
bgp update-delay wait-other-protocol
display bgp peer received prefix-list
graceful-restart timer purge-time
graceful-restart timer restart
graceful-restart timer wait-for-rib
nexthop recursive-lookup delay
nexthop recursive-lookup route-policy
peer advertise additional-paths best
peer capability-advertise conventional
peer capability-advertise orf non-standard
peer capability-advertise orf prefix-list
peer capability-advertise route-refresh
peer capability-advertise suppress-4-byte-as
peer graceful-restart timer restart extra
peer nexthop-recursive-policy disable
Advanced BGP commands
additional-paths select-best
Use additional-paths select-best to set the maximum number of Add-Path optimal routes that can be advertised to all peers.
Use undo additional-paths select-best to restore the default.
Syntax
additional-paths select-best best-number
undo additional-paths select-best
Default
A maximum of one Add-Path optimal route can be advertised to all peers.
Views
BGP IPv4 unicast address family view
BGP IPv6 unicast address family view
Predefined user roles
network-admin
Parameters
best-number: Specifies the maximum number of Add-Path optimal routes that can be advertised to all peers, in the range of 2 to 64.
Usage guidelines
The number of optimal routes cannot exceed the maximum number of Add-Path optimal routes that can be advertised to all peers.
Examples
# In BGP IPv4 unicast address family view, set the maximum number to 3 for Add-Path optimal routes that can be advertised to all peers.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] additional-paths select-best 3
Related commands
peer additional-paths
peer advertise additional-paths best
address-family link-state
Use address-family link-state to create the BGP LS address family and enter its view, or enter the view of the existing address family.
Use undo address-family link-state to remove the BGP LS address family and all its configurations.
Syntax
address-family link-state
undo address-family link-state
Default
No BGP LS address family exists.
Views
BGP instance view
Predefined user roles
network-admin
Usage guidelines
Configurations made in BGP LS address family view apply only to the BGP LS routes and peers of the public network.
Examples
# In BGP instance view, create the BGP LS address family and enter its view.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family link-state
[Sysname-bgp-default-ls]
bgp update-delay wait-other-protocol
Use bgp update-delay wait-other-protocol to configure the time that BGP must wait for other protocols to complete GR after BGP completes GR.
Use undo bgp update-delay wait-other-protocol to restore the default.
Syntax
bgp update-delay wait-other-protocol seconds
undo bgp update-delay wait-other-protocol
Default
After BGP completes GR, it must wait a maximum of 300 seconds for other protocols to complete GR.
Views
BGP instance view
Predefined user roles
network-admin
Parameters
seconds: Specifies the time that BGP must wait for other protocols to complete GR after BGP completes GR. The value range is 60 to 1200 seconds.
Usage guidelines
If the updated routes rely on other protocols, for example, redistributed OSPF routes, BGP starts a wait timer for the other protocols to complete GR. This ensures that incorrect and unreachable routes are not advertised. When the following conditions exist, BGP might advertise incomplete routes after completing GR:
· The routes rely on other protocols.
· BGP maintains a large amount of routing information. In this case, BGP and the protocols take a long time to complete GR.
For BGP to correctly advertise the routes after BGP and the protocols complete GR, set a larger wait timer for BGP.
Examples
# Configure BGP to wait a maximum of 600 seconds for other protocols to complete GR after BGP completes GR.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] bgp update-delay wait-other-protocol 600
Related commands
bgp update-delay on-startup
display bgp link-state
Use display bgp link-state to display BGP LS information.
Syntax
display bgp [ instance instance-name ] link-state [ ls-prefix [ advertise-info | as-path | cluster-list ] | peer { ipv4-address | ipv6-address } { advertised | received } [ statistics ] | statistics ]
Views
Any view
Predefined user roles
network-admin
network-operator
Parameters
instance instance-name: Specifies a BGP instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify this option, the command displays BGP LS information for the default BGP instance.
ls-prefix: Specifies an LS prefix. If you do not specify this argument, the command displays all BGP LS information.
advertise-info: Displays advertisement information for the specified LS prefix.
as-path: Displays AS_PATH attribute information for the specified LS prefix.
cluster-list: Displays CLUSTER_LIST attribute information for the specified LS prefix.
ipv4-address: Specifies a peer by its IPv4 address.
ipv6-address: Specifies a peer by its IPv6 address.
advertised: Displays advertised LS information.
received: Displays received LS information.
statistics: Displays statistics about LS messages.
Usage guidelines
If you do not specify any parameters, this command displays brief BGP LS information.
Examples
# Display brief BGP LS information for the public network.
<Sysname> display bgp link-state
Total number of routes: 2
BGP local router ID is 1.1.2.1
Status codes: * - valid, > - best, d – dampened, h – history,
s – suppressed, S – stale, i - internal, e - external
a - additional-path
Origin: i - IGP, e - EGP, ? - incomplete
Prefix codes: E link, V node, T4 IPv4 route, T6 IPv6 route, SD SRv6 SID desc
u/U unknown,
I Identifier, N local node, R remote node, L link, P prefix,
L1/L2 ISIS level-1/level-2, O OSPF, O3 OSPFv3,
D direct, S static, B BGP, SS SRv6 SID,
a area-ID, l link-ID, t topology-ID, s ISO-ID,
c confed-ID/ASN, b bgp-identifier, r router-ID,
i if-address, n peer-address, o OSPF Route-type, p IP-prefix
d designated router address/interface ID
* >e Network : [V][O][I0x0][N[c20][b1.1.1.2][a0.0.0.0][r1.1.1.2]]/376
NextHop : 1.1.1.2 LocPrf :
PrefVal : 0 OutLabel : NULL
MED :
Path/Ogn: 20i
* >e Network : [T4][O][I0x0][N[c20][b1.1.1.2][a0.0.0.0][r1.1.1.2]][P[o0x1][p1.1.1.0/24]]/480
NextHop : 1.1.1.2 LocPrf :
PrefVal : 0 OutLabel : NULL
MED :
Path/Ogn: 20i
Table 1 Command output
Field |
Description |
Status codes |
Status codes: · * – valid—Valid route. · > – best—Optimal route. · d - dampened—Dampened route. · h – history—History route. · s – suppressed—Suppressed route. · S – stale—Stale route. · i – internal—Internal route. · e – external—External route. · a - additional-path—Add-Path optimal route. |
Prefix codes |
Route prefix codes: · E—Link. · V—Node. · T4—IPv4 route. · T6—IPv6 route. · u/U—Unknown. · I—Identifier. · N—Local node. · R—Remote node. · L—Link. · P—Prefix. · L1/L2—ISIS level-1/level-2. · O—OSPF. · O3—OSPFv3. · D—Direct. · S—Static. · B—BGP. · SS—SRv6 SID. · a—Area-ID. · l—Link-ID. · t—Topology-ID. · s—ISO-ID. · c—Confed-ID/ASN. · b—BGP-identifier. · r—Router-ID. · i—If-address. · n—Peer-address. · o—OSPF Route-type. · p—IP-prefix. · d—Designated router address/interface ID. |
Origin |
Origin of the route: · i – IGP—Originated in the AS. · e – EGP—Learned through EGP. · ? – incomplete—Unknown origin. |
Network |
NLRI for the LS. |
NextHop |
Next hop IP address. |
LocPrf |
Local preference. |
OutLabel |
This field is not supported in the current software version. Outgoing label of the route. |
MED |
MED attribute. |
Path/Ogn |
AS_PATH and ORIGIN attributes of the route: · AS_PATH—Records the ASs the route has passed, which avoids routing loops. · ORIGIN—Identifies the origin of the route. |
bgp-ls-identifier |
Area ID of BGP LS. |
bgp-router-id |
BGP router ID. |
protocol-origin3 |
Configuration origin. |
Flag |
Flag. |
originator-as |
AS number. |
originator-address |
Address identifier. |
discriminator |
Path identifier. |
# Display detailed BGP LS information with the specified LS prefix.
<Sysname> display bgp link-state [V][O][I0x0][N[c20][b1.1.1.2][a0.0.0.0][r1.1.1.2]]/376
BGP local router ID: 1.1.1.2
Local AS number: 20
Paths: 1 available, 1 best
BGP LS information of [V][O][I0x0][N[c20][b1.1.1.2][a0.0.0.0][r1.1.1.2]]/376:
Imported route.
Original nexthop: 0.0.0.0
OutLabel : NULL
RxPathID : 0x0
TxPathID : 0xffffffff
LS : Node flag bits: 30[EA]
AS-path : (null)
Origin : igp
Attribute value : pref-val 32768
State : valid, local, best
IP precedence : N/A
QoS local ID : N/A
Traffic index : N/A
# Display AS_PATH attribute information for a specific LS prefix.
<Sysname> display bgp link-state [V][O][I0x0][N[c20][b1.1.1.2][a0.0.0.0][r1.1.1.2]]/376 as-path
BGP local router ID: 1.1.1.2
Local AS number: 20
Paths: 1 available, 1 best
BGP LS information of [V][O][I0x0][N[c20][b1.1.1.2][a0.0.0.0][r1.1.1.2]]/376:
As-path: 100
# Display CLUSTER_LIST attribute information for a specific LS prefix.
<Sysname> display bgp link-state [V][O][I0x0][N[c20][b1.1.1.2][a0.0.0.0][r1.1.1.2]]/376 cluster-list
BGP local router ID: 1.1.1.2
Local AS number: 20
Paths: 1 available, 1 best
BGP LS information of [V][O][I0x0][N[c20][b1.1.1.2][a0.0.0.0][r1.1.1.2]]/376:
Cluster list: 100
Table 2 Command output
Field |
Description |
Paths |
Number of routes: · available—Number of valid routes. · best—Number of optimal routes. |
BGP LS information of |
NLRI prefix. |
Original nexthop |
Original next hop of the route. If the route was obtained from a BGP update message, the original next hop is the next hop IP address in the message. |
LS |
LS attribute: · Node flag bits—Node attribute in hexadecimal format: ¡ 10[A]—OSPF/OSPFv3 ABR bit. ¡ 30[E]—OSPF/OSPFv3 External bit. · Metric—Link or prefix cost. · Local TE router ID. · Average delay flag—Flag indicating whether the average delay exceeds 16777215 microseconds. ¡ 0: Stable link state whose average delay is not higher than 16777215 microseconds. ¡ 1: Unstable link state whose average delay is higher than 16777215 microseconds. · Average delay—Average delay in microseconds. · Min/Max delay flag—Flag indicating whether the Min/Max delay exceeds 16777215 microseconds. ¡ 0: Stable link state whose Min/Max delay is not higher than 16777215 microseconds. ¡ 1: Unstable link state whose Min/Max delay is higher than 16777215 microseconds. · Min delay—Minimum delay in microseconds. · Max delay—Maximum delay in microseconds. · Delay variation—Acceptable delay variation in microseconds. · Remaining bandwidth—Available bandwidth in bit/s. · Utilized bandwidth—Used bandwidth in bit/s. |
RxPathID |
Add-path ID of received routes. |
TxPathID |
Add-path ID of advertised routes. |
AS-path |
AS_PATH attribute of the route, which records the ASs the route has passed and avoids routing loops. |
Cluster list |
CLUSTER_LIST attribute of the route. |
Attribute value |
BGP path attributes: · MED—MED value. · localpref—Local preference value. · pref-val—Preferred value. · pre—Route preference. |
State |
Current state of the route: · valid. · internal. · external. · local. · synchronize. · best. |
IP precedence |
IP precedence in the range of 0 to 7. N/A indicates that the route does not support this field. |
QoS local ID |
QoS local ID in the range of 1 to 4095. N/A indicates that the route does not support this field. |
Traffic index |
Traffic index in the range of 1 to 64. N/A indicates that the route does not support this field. |
# Display advertisement information for the specified LS prefix.
<Sysname> display bgp link-state [E][B][I0x0][N[r1.1.1.2]][c65008][R[r44.33.22.11]][c65009]][L[i2.1.1.3][n1.1.1.3]]/536 advertise-info
BGP local router ID: 1.1.1.2
Local AS number: 65008
Paths: 1 best
BGP LS information of [E][B][I0x0][N[r1.1.1.2]][c65008][R[r44.33.22.11]][c65009]][L[i2.1.1.3][n1.1.1.3]]/536
(TxPathID:0):
Advertised to peers (1 in total):
10.1.1.2
LS attribute :
Peer node segment identifier : Flag c0[VL], Metric 0, Label 23001
Table 3 Command output
Field |
Description |
Paths |
Number of routes: · available—Number of valid routes. · best—Number of optimal routes. |
BGP LS information of |
NLRI prefix. |
Advertised to peers (1 in total) |
Peers to which the information has been advertised, and the total number of such peers. |
Peer node segment identifier |
This field is not supported in the current software version. Peer node SID: · Flag c0[VL]: ¡ V—Value flag. If set, the SID carries a label value. ¡ L—Local flag. If set, the SID has local significance. · Metric—Link cost. · Label—Label value. |
TxPathID |
Add-path ID of advertised routes. |
# Display BGP LS statistics.
<Sysname> display bgp link-state statistics
Total number of routes: 1
Table 4 Command output
Field |
Description |
Total number of routes |
Number of BGP routes. |
display bgp peer received prefix-list
Use display bgp peer received prefix-list to display the ORF prefix information received by a peer.
Syntax
display bgp [ instance instance-name ] peer ipv4 [ unicast ] ipv4-address received prefix-list
display bgp [ instance instance-name ] peer ipv6 [ unicast ] ipv6-address received prefix-list
display bgp [ instance instance-name ] peer ipv4 [ unicast ] ipv6-address received prefix-list
display bgp [ instance instance-name ] peer ipv6 [ unicast ] ipv4-address received prefix-list
Views
Any view
Predefined user roles
network-admin
network-operator
Parameters
instance instance-name: Specifies a BGP instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify this option, the command displays ORF prefix information for the default BGP instance.
ipv4: Displays BGP IPv4 peer information.
ipv6: Displays BGP IPv6 peer information.
unicast: Displays BGP unicast peer information.
ipv4-address: Specifies a peer by its IPv4 address.
ipv6-address: Specifies a peer by its IPv6 address.
Examples
# Display the ORF prefix information received by peer 10.110.25.20.
<Sysname> display bgp peer ipv4 10.110.25.20 received prefix-list
ORF prefix list entries: 2
index: 10 prefix 1.1.1.0/24 ge 26 le 32
index: 20 prefix 2.1.1.0/24 ge 26 le 32
Table 5 Command output
Field |
Description |
ORF prefix list entries |
Number of ORF prefixes. |
index |
Prefix index. |
prefix |
Prefix information. |
ge |
Greater than or equal to. |
le |
Less than or equal to. |
domain-distinguisher
Use domain-distinguisher to specify an AS number and a router ID for BGP LS messages.
Use undo domain-distinguisher to restore the default.
Syntax
domain-distinguisher as-number:router-id
undo domain-distinguisher
Default
The AS number and router ID of the current BGP process are used.
Views
BGP LS address family view
Predefined user roles
network-admin
Parameters
as-number:router-id: Specifies the AS number and router ID. The value range for the as-number argument is 1 to 4294967295, and the router ID is in IP address format.
Examples
# Set the AS number and router ID for BGP LS messages to 65009 and 1.1.1.1, respectively.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family link-state
[Sysname-bgp-default-ls] domain-distinguisher 65009:1.1.1.1
ebgp-interface-sensitive
Use ebgp-interface-sensitive to enable immediate re-establishment of direct EBGP sessions.
Use undo ebgp-interface-sensitive to disable immediate re-establishment of direct EBGP sessions.
ebgp-interface-sensitive
undo ebgp-interface-sensitive
Immediate re-establishment of direct EBGP sessions is enabled.
network-admin
When a direct link to an EBGP peer fails, BGP tears down the session and re-establishes a session to the peer immediately. If the feature is not enabled, the router does not tear down the session until the hold time expires. However, disabling this feature can prevent routing flaps from affecting EBGP session state.
This command applies only to direct EBGP sessions.
# Enable immediate re-establishment of direct EBGP sessions.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] ebgp-interface-sensitive
fast-reroute route-policy
Use fast-reroute route-policy to apply a routing policy to fast reroute (FRR) for a BGP address family.
Use undo fast-reroute route-policy to restore the default.
fast-reroute route-policy route-policy-name
undo fast-reroute route-policy
No routing policy is applied to FRR.
BGP IPv4 unicast address family view
BGP IPv6 unicast address family view
network-admin
route-policy-name: Specifies a routing policy by its name, a case-sensitive string of 1 to 63 characters.
You can use the following methods to configure BGP FRR:
· Method 1—Execute the pic command in BGP address family view. BGP calculates a backup next hop for a BGP route in the address family if there are two or more unequal-cost routes to reach the destination.
· Method 2—Execute the fast-reroute route-policy command to use a routing policy in which a backup next hop is specified by using the command apply [ ipv6 ] fast-reroute backup-nexthop. For BGP to generate a backup next hop for the primary route, the backup next hop calculated by BGP must be the same as the specified backup next hop. You can also configure if-match clauses in the routing policy to identify the routes protected by FRR.
If both methods are configured, Method 2 takes precedence over Method 1.
# Apply routing policy frr-policy to FRR in BGP IPv4 unicast address family view.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4
[Sysname-bgp-default-ipv4] fast-reroute route-policy frr-policy
apply fast-reroute
apply ipv6 fast-reroute
pic
route-policy
flush suboptimal-route
Use flush suboptimal-route to enable BGP to flush the suboptimal BGP route to the RIB.
Use undo flush suboptimal-route to disable BGP from flushing the suboptimal BGP route to the RIB.
flush suboptimal-route
undo flush suboptimal-route
BGP is disabled from flushing the suboptimal BGP route to the RIB. Only the optimal route is flushed to the RIB.
network-admin
This command flushes the suboptimal BGP route to the RIB when the following conditions are met:
· The optimal route is generated by the network command or is redistributed by the import-route command.
· The suboptimal route is received from a BGP peer.
After the suboptimal route is flushed to the RIB on a network, BGP immediately switches traffic to the suboptimal route when the optimal route fails.
For example, the device has a static route to the subnet 1.1.1.0/24 that has a higher priority than a BGP route. BGP redistributes the static route and receives a route to 1.1.1.0/24 from a peer. After the flush suboptimal-route command is executed, BGP flushes the received BGP route to the RIB as the suboptimal route. When the static route fails, BGP immediately switches traffic to the suboptimal route if inter-protocol FRR is enabled. For more information about inter-protocol FRR, see Layer 3—IP Routing Configuration Guide.
# Enable BGP to flush the suboptimal BGP route to the RIB.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] flush suboptimal-route
graceful-restart
Use graceful-restart to enable BGP Graceful Restart (GR) capability.
Use undo graceful-restart to disable BGP GR capability.
graceful-restart
undo graceful-restart
BGP GR capability is disabled.
network-admin
GR ensures continuous forwarding when BGP restarts or an active/standby switchover occurs.
BGP peers exchange Open messages containing GR information. If both parties have GR capability, they establish a GR-capable session.
After you execute this command, the device re-establishes BGP sessions.
# Enable GR capability for BGP process 100.
[Sysname] bgp 100
[Sysname-bgp-default] graceful-restart
graceful-restart timer purge-time
graceful-restart timer restart
graceful-restart timer wait-for-rib
graceful-restart peer-reset
Use graceful-restart peer-reset to enable BGP to reset peer sessions gracefully.
Use undo graceful-restart peer-reset to disable BGP from resetting peer sessions gracefully.
Syntax
graceful-restart peer-reset [ all ]
undo graceful-restart peer-reset
Default
BGP does not reset peer sessions gracefully.
Views
BGP instance view
Predefined user roles
network-admin
Parameters
all: Enables BGP to reset peer sessions gracefully when the TCP connection goes down, the hold timer expires, or the address families supporting route exchange change. If you do not specify this keyword, BGP resets peer sessions gracefully only when the address families supporting route exchange change.
Usage guidelines
When the TCP connection goes down, the hold timer expires, or the address families supporting route exchange change, BGP tears down and then re-establishes the peer sessions, which will cause traffic interruption. To avoid traffic interruption in these cases, execute this command to enable BGP to reset peer sessions gracefully.
Examples
# Enable BGP to reset peer sessions gracefully.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] graceful-restart
[Sysname-bgp-default] graceful-restart peer-reset
Related commands
graceful-restart
graceful-restart timer purge-time
Use graceful-restart timer purge-time to set the Routing Information Base (RIB) purge timer.
Use undo graceful-restart timer purge-time to restore the default.
graceful-restart timer purge-time timer
undo graceful-restart timer purge-time
The RIB purge timer is 480 seconds.
network-admin
timer: Sets the RIB purge timer in the range of 1 to 6000 seconds.
BGP starts the RIB purge timer when an active/standby switchover occurs or BGP restarts. If BGP route exchange is not completed within the RIB purge timer, the GR restarter quits the GR process. It updates the RIB with the BGP routes already learned, and removes the stale routes from RIB.
Enable BGP GR before you execute this command.
Set the RIB purge timer to be long enough to complete GR, especially when large numbers of BGP routes exist.
As a best practice, set the RIB purge timer in the following way:
· Set the timer to be greater than the timer set by the graceful-restart timer wait-for-rib command
· Set the timer to be less than the timer set by the protocol lifetime command.
# Set the RIB purge timer to 300 seconds.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] graceful-restart
[Sysname-bgp-default] graceful-restart timer purge-time 300
graceful-restart
graceful-restart timer restart
graceful-restart timer wait-for-rib
protocol lifetime (Layer 3—IP Routing Command Reference)
graceful-restart timer restart
Use graceful-restart timer restart to configure the GR timer.
Use undo graceful-restart timer restart to restore the default.
graceful-restart timer restart timer
undo graceful-restart timer restart
The GR timer is 150 seconds.
network-admin
timer: Specifies the GR timer in the range of 3 to 600 seconds.
The GR restarter sends the GR timer to the GR helper in an Open message. When the GR helper detects that an active/standby switchover or a BGP restart occurred on the GR restarter, the GR helper performs the following operations:
1. Marks all routes learned from the GR restarter as stale.
2. Starts the GR timer.
3. If no BGP session is established before the GR timer expires, the GR helper removes the stale routes.
Before you configure this command, enable the BGP GR capability.
To apply a new GR timer, you must re-establish BGP sessions.
# Set the GR timer to 300 seconds.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] graceful-restart
[Sysname-bgp-default] graceful-restart timer restart 300
graceful-restart timer purge-time
graceful-restart timer wait-for-rib
graceful-restart timer wait-for-rib
Use graceful-restart timer wait-for-rib to configure the time to wait for the End-of-RIB marker.
Use undo graceful-restart timer wait-for-rib to restore the default.
graceful-restart timer wait-for-rib timer
undo graceful-restart timer wait-for-rib
The time to wait for the End-of-RIB marker is 600 seconds.
network-admin
timer: Specifies the time to wait for the End-of-RIB marker, in the range of 3 to 3600 seconds.
BGP uses this timer to control the time to receive updates from the peer. The timer is not advertised to the peer.
After the GR restarter and GR helper re-establish a BGP session, they start this timer. If they do not complete route exchange within the time period, the GR restarter does not receive new routes. It updates its routing table and forwarding table with learned BGP routes, and the GR helper removes the stale routes. Set a large value for the maximum time to wait for the End-of-RIB marker when a large number of routes exist.
This command controls the routing convergence speed. A smaller timer value means faster routing convergence but possibly results in incomplete routing information.
Before configuring this command, you must enable the BGP GR capability.
# Set the time to wait for the End-of-RIB marker on the local end to 100 seconds.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] graceful-restart
[Sysname-bgp-default] graceful-restart timer wait-for-rib 100
graceful-restart
graceful-restart timer purge-time
graceful-restart timer restart
ignore all-peers
Use ignore all-peers to disable BGP session establishment with all peers and peer groups.
Use undo ignore all-peers to restore the default.
Syntax
ignore all-peers [ graceful graceful-time { community { community-number | aa:nn } | local-preference preference | med med } * ]
undo ignore all-peers
Default
BGP can establish sessions to all peers and peer groups.
Views
BGP instance view
Predefined user roles
network-admin
Parameters
graceful graceful-time: Sets the time to wait before the device shuts down all BGP sessions to peers and peer groups. The value range for the graceful-time argument is 0 to 65535 seconds. If you set the value for the graceful-time argument to 0, BGP does not shut down all BGP sessions to peers and peer groups. If you do not specify this option, the command immediately shuts down the sessions to all peers and peer groups.
community { community-number | aa:nn }: Specifies the community attribute for routes advertised to all peers and peer groups. The community-number argument represents the community sequence number in the range of 1 to 4294967295. The aa:nn argument represents the community number. Both aa and nn are in the range of 0 to 65535. If you do not specify this option, the command does not change the community attribute for routes advertised to all peers and peer groups.
local-preference preference: Specifies the local preference for routes advertised to all peers and peer groups, in the range of 0 to 4294967295. A larger value represents a higher preference. If you do not specify this option, the command does not change the local preference for routes advertised to all peers and peer groups.
med med: Specifies the MED value for routes advertised to all peers and peer groups, in the range of 0 to 4294967295. The smaller the MED value, the higher the route priority. If you do not specify this option, the command does not change the MED value for routes advertised to all peers and peer groups.
Usage guidelines
CAUTION: Executing the ignore all-peers command tears down all existing sessions to peers and peer groups and clears all related routing information. |
This command enables you to temporarily tear down the BGP sessions to all peers and peer groups. You can perform network upgrade and maintenance without needing to delete and reconfigure the peers and peer groups. To recover the sessions, execute the undo ignore all-peers command.
If you specify the graceful keyword in the ignore all-peers command, BGP performs the following tasks:
1. Starts the wait timer specified with the graceful keyword.
2. Advertises all routes to all peers and peer groups and changes the attribute for the advertised routes to the specified value.
3. Shuts down all sessions to peers and peer groups after the wait timer expires.
This configuration lowers the priority of the routes advertised by BGP and BGP peers can select other peers' routes as optimal routes, which avoids traffic interruption upon wait timer expiration or peer disconnection. To enable BGP to advertise low-priority routes without tearing down BGP sessions, you can set the value for the graceful graceful-time option to 0.
For a BGP peer or peer group, the configuration made by the peer ignore command takes precedence over the configuration made by the ignore all-peers command.
Examples
# In BGP instance view, configure BGP to gracefully shut down the sessions to all peers and peer groups in 60 seconds, advertise all routes to all peers and peer groups, and change the community attribute and local preference for the advertised routes to 1:1 and 200, respectively.
<Sysname> system-view
[Sysname] bgp 1
[Sysname-bgp-default] ignore all-peers graceful 60 community 1:1 local-preference 200
Related commands
peer ignore
isolate enable
Use isolate enable to enable BGP isolation.
Use undo isolate enable to restore the default.
Syntax
isolate enable
undo isolate enable
Default
BGP isolation is disabled.
Views
BGP instance view
Predefined user roles
network-admin
Usage guidelines
To maintain a BGP network device, you can use BGP isolation to remove the device from the network. This feature reduces configuration workload and impact on the network by retaining the device configuration during the maintenance. After maintenance, you can disable BGP isolation to add the device back to the network.
BGP isolation works as follows:
1. BGP withdraws all routes advertised by the device except for the direct routes.
2. BGP keeps all routes learned from its peers.
3. Each peer of the device reselects an optimal route and updates the FIB table. During optimal route selection, the peers can still use the routes advertised by the device to forward traffic.
4. After an optimal route is selected and the FIB table is updated, the peers stop forwarding packets except for those destined for the device to the device. The device is fully isolated from the network and you can upgrade it.
5. After the maintenance, disable BGP isolation on the device to gracefully add it back to the network. After returning to the network, the device advertises and learns routes as follows:
¡ Advertises routes to its peers.
¡ Learns routes if BGP was reset during the isolation.
To avoid isolation failure, do not use this feature when GR is enabled for the device.
Examples
# Isolate the device from the network in BGP instance view.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] isolate enable
nexthop recursive-lookup delay
Use nexthop recursive-lookup delay to set the delay time for responding to recursive next hop changes.
Use undo nexthop recursive-lookup delay to disable BGP from delaying responding to recursive next hop changes.
Syntax
nexthop recursive-lookup [ non-critical-event ] delay [ delay-value ]
undo nexthop recursive-lookup [ non-critical-event ] delay
Default
BGP responds to recursive next hop changes immediately.
Views
BGP IPv4 unicast address family view
BGP IPv6 unicast address family view
BGP LS address family view
Predefined user roles
network-admin
Parameters
non-critical-event: Delays responding to noncritical next hop changes. If you do not specify this keyword, BGP delays responding to both critical and noncritical next hop changes.
Next hop changes include the following types:
· Critical route recursion changes—Changes that cause route unreachability and service interruption. For example, a BGP route cannot find a recursive next hop because of network failures.
· Noncritical route recursion changes—A recursive or related route changes but the change will not cause route unreachability or service interruption. For example, the recursive interface of a BGP route changes but traffic forwarding is not affected.
delay-value: Specifies a delay time in the range of 1 to 240 seconds. The default delay time is 5 seconds.
Usage guidelines
When recursive or related routes change frequently, configure this command to reduce unnecessary path selection and update messages and prevent traffic loss.
To avoid traffic loss, do not configure this command if only one route is available to a specific destination.
Set an appropriate delay time based on your network condition. A short delay time cannot reduce unnecessary path selection or update messages, and a long delay time might cause traffic loss.
When you configure both the nexthop recursive-lookup delay and nexthop recursive-lookup non-critical-event delay commands for an address family, follow these guidelines:
· BGP delays responding to both critical and noncritical next hop changes in the address family.
· For noncritical next hop changes, the delay time specified by the nexthop recursive-lookup non-critical-event delay command takes effect.
If you execute the nexthop recursive-lookup delay command multiple times, the most recent configuration takes effect.
If you execute the nexthop recursive-lookup non-critical-event delay command multiple times, the most recent configuration takes effect.
Examples
# In BGP IPv4 unicast address family view, set the delay time for responding to recursive next hop changes to 100 seconds.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] nexthop recursive-lookup delay 100
nexthop recursive-lookup route-policy
Use nexthop recursive-lookup route-policy to enable routing policy-based nexthop recursion.
Use undo nexthop recursive-lookup route-policy to restore the default.
Syntax
nexthop recursive-lookup route-policy route-policy-name
undo nexthop recursive-lookup route-policy
Default
BGP does not perform routing policy-based nexthop recursion for routes.
Views
BGP IPv4 unicast address family view
BGP IPv6 unicast address family view
BGP LS address family view
Predefined user roles
network-admin
Parameters
route-policy-name: Specifies a routing policy by its name, a case-sensitive string of 1 to 63 characters.
Usage guidelines
CAUTION: Before executing this command, make sure that BGP routes can be iterated to the desired paths under the constraints of the specified routing policy. If the recursion results of a BGP route are all filtered out by the specified routing policy, BGP considers the route unreachable. |
Application scenarios
When BGP performs nexthop recursion for a route without any constraints, the route might be iterated to an incorrect traffic forwarding path. To resolve this issue, use this command to enable routing policy-based nexthop recursion. BGP can then iterate routes to the desired forwarding paths under the constraints of the specified routing policy.
Operating mechanism
With this command configured, a BGP route can take effect only when some of its nexthop recursion results can match a permit node of the specified routing policy. If the recursion results of a route are all filtered out by the specified routing policy, the route is considered unreachable and cannot take effect.
Restrictions and guidelines
· Before configuring this command for an address family, perform the following task:
a. Determine the routes to which that the BGP routes in that address family can be iterated.
b. Configure a routing policy that contains the desired match criteria.
· After you configure this command for an address family, BGP reperforms next hop recursion for the routes in that address family.
· If the routing policy specified in this command does not exist, this command does not take effect. It will take effect immediately after you create the specified routing policy.
· This command does not take effect on the routes learned from directly-connected EBGP peers.
· This command does not take effect on the routes learned from the specified peer or peer group when you configure this command together with the peer nexthop-recursive-policy disable command.
· When you configure the nexthop recursive-lookup route-policy command and the protocol nexthop recursive-lookup command, follow these restrictions and guidelines:
¡ If the following conditions exist, only the nexthop recursive-lookup route-policy command takes effect on the routes in a BGP address family:
- You configure the nexthop recursive-lookup route-policy command in the view of the BGP address family.
- You configure the protocol nexthop recursive-lookup command in RIB IPv4 or IPv6 address family view.
¡ If the following conditions exist, BGP performs nexthop recursion for the routes in a BGP address family according to the configuration of the protocol nexthop recursive-lookup command in RIB IPv4 or IPv6 address family view:
- You do not configure the nexthop recursive-lookup route-policy command in the view of the BGP address family.
- You configure the protocol nexthop recursive-lookup command in RIB IPv4 or IPv6 address family view.
Examples
# In BGP IPv4 unicast address family view, specify routing policy test-policy to filter the nexthop recursion results of public BGP IPv4 unicast routes.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv6] nexthop recursive-lookup route-policy test-policy
Related commands
peer nexthop-recursive-policy disable
protocol nexthop recursive-lookup (Layer 3—IP Routing Command Reference)
peer additional-paths
Use peer additional-paths to configure the BGP Additional Paths capabilities.
Use undo peer additional-paths to remove the configuration.
Syntax
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } additional-paths { receive | send } *
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } additional-paths { receive | send } *
Default
No BGP Additional Paths capabilities are configured.
Views
BGP IPv4 unicast address family view
BGP IPv6 unicast address family view
Predefined user roles
network-admin
Parameters
group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.
ipv4-address: Specifies a peer by its IPv4 address. The peer must have been created.
mask-length: Specifies a mask length in the range of 0 to 32. You can use the ipv4-address and mask-length arguments together to specify a subnet. If you specify a subnet, this command configures the BGP Additional Paths capabilities for all dynamic peers in the subnet.
ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.
prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a subnet. If you specify a subnet, this command configures the BGP Additional Paths capabilities for all dynamic peers in the subnet.
receive: Enables the BGP additional path receiving capability.
send: Enables the BGP additional path sending capability.
Usage guidelines
You can enable the BGP additional path sending, receiving, or both sending and receiving capabilities on a BGP router. For two BGP peers to successfully negotiate the Additional Paths capabilities, make sure one end has the sending capability and the other end has the receiving capability.
Examples
# In BGP IPv4 unicast address family view, enable the BGP additional path receiving capability.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] peer 1.1.1.1 additional-paths receive
peer advertise additional-paths best
Use peer advertise additional-paths best to set the maximum number of Add-Path optimal routes that can be advertised to a peer or peer group.
Use undo peer advertise additional-paths best to remove the configuration.
Syntax
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } advertise additional-paths best number
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } advertise additional-paths best
Default
A maximum of one Add-Path optimal route can be advertised to a peer or peer group.
Views
BGP IPv4 unicast address family view
BGP IPv6 unicast address family view
Predefined user roles
network-admin
Parameters
group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.
ipv4-address: Specifies a peer by its IPv4 address. The peer must have been created.
mask-length: Specifies a mask length in the range of 0 to 32. You can use the ipv4-address and mask-length arguments together to specify a subnet. If you specify a subnet, this command sets the maximum number of Add-Path optimal routes that can be advertised to all dynamic peers in the subnet.
ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.
prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a subnet. If you specify a subnet, this command sets the maximum number of Add-Path optimal routes that can be advertised to all dynamic peers in the subnet.
number: Specifies the maximum number of Add-Path optimal routes that can be advertised to a peer or peer group, in the range of 2 to 64.
Usage guidelines
If the number of Add-Path optimal routes advertised to a peer or peer group exceeds the number of optimal routes, the number of optimal routes takes effect.
Examples
# In BGP IPv4 unicast address family view, set the maximum number to 3 for Add-Path optimal routes that can be advertised to peer 1.1.1.1.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] peer 1.1.1.1 advertise additional-paths best 3
Related commands
additional-paths select-best
peer additional-paths
peer bfd
Use peer bfd to enable BFD for the link to a BGP peer or peer group.
Use undo peer bfd to remove the configuration.
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } bfd [ echo | multi-hop | single-hop ]
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } bfd
BFD is disabled for the link to a BGP peer or peer group.
network-admin
group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.
ipv4-address: Specifies a peer by its IPv4 address. The peer must have been created.
mask-length: Specifies a mask length in the range of 0 to 32. You can use the ipv4-address and mask-length arguments together to specify a subnet. If you specify a subnet, this command enables BFD for links to all dynamic peers in the subnet.
ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.
prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a subnet. If you specify a subnet, this command enables BFD for links to all dynamic peers in the subnet.
echo: Specifies the echo packet mode for BFD.
multi-hop: Specifies the control packet mode for multi-hop BFD.
single-hop: Specifies the control packet mode for single-hop BFD.
When you do not specify the multi-hop, single-hop, or echo keyword:
· If an IBGP peer or peer group is specified, this command enables multi-hop BFD in control packet mode for the IBGP peer or peer group.
· If a directly connected EBGP peer or peer group is specified and the peer ebgp-max-hop command is not configured, this command enables single-hop BFD in control packet mode for the EBGP peer or peer group. If the EBGP peer or peer group is not directly connected or the peer ebgp-max-hop command is configured, this command enables multi-hop BFD in control packet mode for the EBGP peer or peer group.
Follow these restrictions and guidelines when you configure echo packet mode BFD:
· Echo packet mode BFD is applicable only to directly connected BGP peers.
· Echo packet mode BFD is not applicable to BGP peers established by using loopback interfaces.
· For successful BFD session establishment, make sure a source address has been specified for echo packets by using the bfd echo-source-ip or bfd echo-source-ipv6 command.
To detect the link to a BGP peer established through link-local addresses, you must configure single-hop BFD in control packet mode.
To establish a control packet mode BFD session to a BGP peer, you must configure the same BFD detection mode (multi-hop or single-hop) on the local router and the BGP peer.
For more information about BFD, see BFD configuration in High Availability Configuration Guide.
BFD helps speed up BGP routing convergence upon link failures. However, if you have enabled GR, use BFD with caution. BFD might detect a failure before the system performs GR, resulting in GR failure. If you have enabled both BFD and GR for BGP, do not disable BFD during a GR process to avoid GR failure.
# In BGP instance view, enable control packet mode single-hop BFD for the link to BGP peer group test.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] peer test bfd single-hop
bfd echo-source-ip (High Availability Command Reference)
bfd echo-source-ipv6 (High Availability Command Reference)
display bgp peer
display bfd session (High Availability Command Reference)
peer bfd parameters
Use peer bfd parameters to configure BFD parameters for the specified BGP peer or peer group.
Use undo peer bfd parameters to restore the default.
Syntax
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } bfd parameters { detect-multiplier detect-multiplier | min-receive-interval min-receive-interval | min-transmit-interval min-transmit-interval } *
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } bfd parameters { detect-multiplier | min-receive-interval | min-transmit-interval } *
Default
No BFD parameters are configured for a BGP peer or peer group.
Views
BGP instance view
BGP-VPN instance view
Predefined user roles
network-admin
Parameters
group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.
ipv4-address: Specifies a peer by its IPv4 address. The peer must have been created.
mask-length: Specifies a mask length in the range of 0 to 32. You can use the ipv4-address and mask-length arguments together to specify a subnet. If you specify a subnet, this command takes effect on all dynamic peers in the subnet.
ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.
prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a subnet. If you specify a subnet, this command takes effect on all dynamic peers in the subnet.
detect-multiplier detect-multiplier: Specifies the detection time multiplier. The value range for the detect-multiplier argument is 3 to 50.
min-receive-interval min-receive-interval: Specifies the minimum interval for receiving BFD control packets, , in milliseconds. The value range for the min-receive-interval argument is 100 to 10000.
min-transmit-interval min-transmit-interval: Specifies the minimum interval for transmitting BFD control packets, , in milliseconds. The value range for the min-transmit-interval argument is 100 to 10000.
Usage guidelines
When you configure BFD parameters for a BGP peer or peer group, follow these restrictions and guidelines:
· When you add a peer to a peer group, the peer will inherit the BFD settings of the peer group.
· When you configure BFD parameters for a peer group, the configuration takes effect on all peers in the peer group.
· If you configure a BFD parameter multiple times for a peer or peer group, the most recent configuration takes effect.
· For a peer, the most recent configuration of a BFD parameter takes effect regardless of the configuration source.
Examples
# Configure BFD parameters for peer 2.2.2.9.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] peer 2.2.2.9 bfd parameters min-transmit-interval 100 min-receive-interval 100 detect-multiplier 5
Related commands
display bfd session (High Availability Command Reference)
display bgp peer
peer bfd
peer capability-advertise conventional
Use peer capability-advertise conventional to disable the BGP multi-protocol extension, route refresh, and 4-byte AS number features for a peer or peer group.
Use undo peer capability-advertise conventional to enable the BGP multi-protocol extension, route refresh, and 4-byte AS number features for a peer or peer group.
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } capability-advertise conventional
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } capability-advertise conventional
The BGP multi-protocol extension, route refresh, and 4-byte AS number features are enabled.
network-admin
group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.
ipv4-address: Specifies a peer by its IPv4 address. The peer must have been created.
mask-length: Specifies a mask length in the range of 0 to 32. You can use the ipv4-address and mask-length arguments together to specify a subnet. If you specify a subnet, this command disables BGP multi-protocol extension and route refresh for all dynamic peers in the subnet.
ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.
prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a subnet. If you specify a subnet, this command disables BGP multi-protocol extension and route refresh for all dynamic peers in the subnet.
The route refresh feature enables BGP to send and receive Route-refresh messages and implement BGP session soft-reset.
The multi-protocol extension feature enables BGP to advertise and receive routing information for various protocols (for example, IPv6 routing information).
The 4-byte AS number feature enables BGP to use 4-byte AS numbers in the range of 1 to 4294967295.
If both the peer capability-advertise conventional and peer capability-advertise route-refresh commands are executed, the most recent configuration takes effect.
# In BGP instance view, disable the multi-protocol extension, route refresh, and 4-byte AS number features for peer 1.1.1.1.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] peer 1.1.1.1 as-number 100
[Sysname-bgp-default] peer 1.1.1.1 capability-advertise conventional
display bgp peer
peer capability-advertise route-refresh
peer capability-advertise orf non-standard
Use peer capability-advertise orf non-standard to enable nonstandard ORF capabilities negotiation for a peer or peer group.
Use undo peer capability-advertise orf non-standard to disable nonstandard ORF capabilities negotiation for a peer or peer group.
Syntax
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } capability-advertise orf non-standard
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } capability-advertise orf non-standard
Default
Nonstandard ORF capabilities negotiation is disabled for a peer or peer group.
Views
BGP instance view
Predefined user roles
network-admin
Parameters
group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.
ipv4-address: Specifies a peer by its IPv4 address. The peer must have been created.
mask-length: Specifies a mask length in the range of 0 to 32. You can use the ip-address and mask-length arguments together to specify a subnet. If you specify a subnet, this command enables BGP to negotiate nonstandard ORF capabilities with all dynamic peers in the subnet.
ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.
prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a subnet. If you specify a subnet, this command enables BGP to negotiate nonstandard ORF capabilities with all dynamic peers in the subnet.
Usage guidelines
To enable BGP peers to negotiate nonstandard ORF capabilities, you must configure this command together with the peer capability-advertise orf prefix-list command.
Examples
# Enable nonstandard ORF capabilities negotiation for peer 1.1.1.1.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] peer 1.1.1.1 capability-advertise orf non-standard
Related commands
peer capability-advertise orf prefix-list
peer capability-advertise orf prefix-list
Use peer capability-advertise orf prefix-list to enable BGP ORF capabilities negotiation for a peer or peer group.
Use undo peer capability-advertise orf prefix-list to disable BGP ORF capabilities negotiation for a peer or peer group.
Syntax
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } capability-advertise orf prefix-list { both | receive | send }
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } capability-advertise orf prefix-list { both | receive | send }
Default
BGP ORF capabilities are disabled.
Views
BGP IPv4 unicast address family view
BGP IPv6 unicast address family view
Predefined user roles
network-admin
Parameters
group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.
ipv4-address: Specifies a peer by its IPv4 address. The peer must have been created.
mask-length: Specifies a mask length in the range of 0 to 32. You can use the ipv4-address and mask-length arguments together to specify a subnet. If you specify a subnet, this command specifies all dynamic peers in the subnet.
ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.
prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a subnet. If you specify a subnet, this command specifies all dynamic peers in the subnet.
both: Enables BGP to send and receive route fresh messages that carry the ORF information.
receive: Enables BGP to receive route fresh messages that carry the ORF information.
send: Enables BGP to send route fresh messages that carry the ORF information.
Usage guidelines
After you configure this command, the BGP peers negotiate the ORF capabilities through Open messages. After completing the negotiation process, the BGP peers can exchange ORF information through route refresh messages. To enable the peers to exchange nonstandard ORF information, you must also configure the peer capability-advertise orf non-standard command.
Examples
# Enables BGP ORF capabilities negotiation for peer 1.1.1.1.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4
[Sysname-bgp-default-ipv4] peer 1.1.1.1 capability-advertise orf prefix-list both
Related commands
peer capability-advertise orf non-standard
peer capability-advertise route-refresh
Use peer capability-advertise route-refresh to enable BGP route refresh for a peer or peer group.
Use undo peer capability-advertise route-refresh to disable BGP route refresh for a peer or peer group.
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } capability-advertise route-refresh
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } capability-advertise route-refresh
BGP route refresh is enabled.
network-admin
group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.
ipv4-address: Specifies a peer by its IPv4 address. The peer must have been created.
mask-length: Specifies a mask length in the range of 0 to 32. You can use the ipv4-address and mask-length arguments together to specify a subnet. If you specify a subnet, this command enables BGP route refresh for all dynamic peers in the subnet.
ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.
prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a subnet. If you specify a subnet, this command enables BGP route refresh for all dynamic peers in the subnet.
The route refresh feature enables BGP to send and receive Route-refresh messages.
BGP uses the route refresh feature to implement BGP session soft-reset. After a policy is modified, the router advertises a Route-refresh message to the peers. The peers resend their routing information to the router. After receiving the routing information, the router filters the routing information by using the new policy. This method allows you to refresh the BGP routing table and apply the new route selection policy without tearing down BGP sessions.
BGP route refresh requires that both the local router and the peer support route refresh.
If both the peer capability-advertise route-refresh and peer capability-advertise conventional commands are executed, the most recent configuration takes effect.
# In BGP instance view, enable BGP route refresh for peer 1.1.1.1.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] peer 1.1.1.1 as-number 100
[Sysname-bgp-default] peer 1.1.1.1 capability-advertise route-refresh
display bgp peer
peer capability-advertise conventional
peer keep-all-routes
refresh bgp
peer capability-advertise suppress-4-byte-as
Use peer capability-advertise suppress-4-byte-as to enable 4-byte AS number suppression.
Use undo peer capability-advertise suppress-4-byte-as to disable 4-byte AS number suppression.
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } capability-advertise suppress-4-byte-as
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } capability-advertise suppress-4-byte-as
The 4-byte AS number suppression feature is disabled.
network-admin
group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.
ipv4-address: Specifies a peer by its IPv4 address. The peer must have been created.
mask-length: Specifies a mask length in the range of 0 to 32. You can use the ipv4-address and mask-length arguments together to specify a subnet. If you specify a subnet, this command enables 4-byte AS number suppression for all dynamic peers in the subnet.
ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.
prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a subnet. If you specify a subnet, this command enables 4-byte AS number suppression for all dynamic peers in the subnet.
BGP supports 4-byte AS numbers. The 4-byte AS number occupies four bytes, in the range of 1 to 4294967295. By default, a device sends an Open message to the peer device for session establishment. The Open message indicates that the device supports 4-byte AS numbers. If the peer device supports 2-byte AS numbers instead of 4-byte AS numbers, the session cannot be established. To resolve this issue, enable the 4-byte AS number suppression feature. The device then sends an Open message to inform the peer that it does not support 4-byte AS numbers, so the BGP session can be established.
If the peer device supports 4-byte AS numbers, do not enable the 4-byte AS number suppression feature. If this feature is enabled, the BGP session cannot be established.
# In BGP instance view, enable 4-byte AS number suppression for peer 1.1.1.1.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] peer 1.1.1.1 as-number 100
[Sysname-bgp-default] peer 1.1.1.1 capability-advertise suppress-4-byte-as
display bgp peer
peer dscp
Use peer dscp to set a DSCP value for outgoing BGP packets.
Use undo peer dscp to remove the configuration.
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } dscp dscp-value
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } dscp
The DSCP value for outgoing BGP packets is 48.
network-admin
group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.
ipv4-address: Specifies a peer by its IPv4 address. The peer must have been created.
mask-length: Specifies a mask length in the range of 0 to 32. You can use the ipv4-address and mask-length arguments together to specify a subnet. If you specify a subnet, this command specifies a DSCP value for outgoing BGP packets to all dynamic peers in the subnet.
ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.
prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a subnet. If you specify a subnet, this command specifies a DSCP value for outgoing BGP packets to all dynamic peers in the subnet.
dscp-value: Specifies a DSCP value in the range of 0 to 63.
The DSCP value of an IP packet specifies the priority level of the packet and affects the transmission priority of the packet. A larger DSCP value represents a higher priority.
# In BGP instance view, set the DSCP value to 10 for outgoing BGP packets to peer group test.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] peer test dscp 10
peer flap-dampen
Use peer flap-dampen to configure flap dampening for a peer or peer group.
Use undo peer flap-dampen to disable flap dampening for a peer or peer group.
Syntax
peer { group-name | ipv4-address | ipv6-address } flap-dampen [ max-idle-time max-time | min-established-time min-time ] *
undo peer { group-name | ipv4-address | ipv6-address } flap-dampen
Default
Flap dampening is disabled for all peers and peer groups.
Views
BGP instance view
Predefined user roles
network-admin
Parameters
group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.
ipv4-address: Specifies a peer by its IPv4 address. The peer must have been created.
ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.
max-time: Specifies the maximum time during which a BGP peer remains in idle state. The value range for this argument is 1 to 65536 seconds, and the default value is 1800 seconds.
min-time: Specifies the minimum time during which a BGP peer remains in Established state so as to exit the dampened state. The value range for this argument is 1 to 4294967295 seconds, and the default value is 600 seconds.
Usage guidelines
Execute this command to dampen a BGP peer when the peer state frequently changes between up and down. BGP increases the idle time of the peer each time the peer comes up until the maximum idle time is reached. To exit the dampened state, the peer must remain in Established state for a time period longer than the minimum established time. After the peer exits the dampened state, BGP resets the idle time of the peer when the peer comes up again.
Set a maximum idle time and a minimum established time based on your network condition.
Examples
# In BGP instance view, enable flap dampening for peer group test, and set the maximum idle time and minimum established time to 800 seconds and 2000 seconds, respectively.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] peer test flap-dampen max-idle-time 800 min-established-time 2000
peer graceful-restart timer restart extra
Use peer graceful-restart timer restart extra to set the extra time to wait after the restart timer expires.
Use undo peer graceful-restart timer restart extra to restore the default.
Syntax
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } graceful-restart timer restart extra { time | no-limit }
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } graceful-restart timer restart extra
Default
The extra time to wait after the restart timer expires is 0 seconds.
Views
BGP instance view
Predefined user roles
network-admin
Parameters
group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.
ipv4-address: Specifies a peer by its IPv4 address. The peer must have been created.
mask-length: Specifies a mask length in the range of 0 to 32. You can use the ipv4-address and mask-length arguments together to specify a subnet. If you specify a subnet, this command specifies all dynamic peers in the subnet.
ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.
prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a subnet. If you specify a subnet, this command specifies all dynamic peers in the subnet.
time: Specifies the extra time to wait after the restart timer expires, in the range of 0 to 86400 seconds.
no-limit: Sets an unlimited time to wait for BGP session re-establishment.
Usage guidelines
After the active/standby switchover or BGP restart completes, the GR helper marks the routes it learned from the GR restarter as stale routes. If the GR helper fails to establish a BGP session after both the GR timer and the extra timer to wait expire, the GR helper removes the stale routes.
Examples
# Set the extra time to wait after the restart timer expires to 100 seconds.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] peer 10.1.100.2 graceful-restart timer restart extra 100
Related commands
graceful-restart timer restart
peer ignore
Use peer ignore to disable BGP session establishment with a peer or peer group.
Use undo peer ignore to enable BGP session establishment with a peer or peer group.
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } ignore [ graceful graceful-time { community { community-number | aa:nn } | local-preference preference | med med } * ]
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } ignore
BGP can establish a session to a peer or peer group.
network-admin
group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.
ipv4-address: Specifies a peer by its IPv4 address. The peer must have been created.
mask-length: Specifies a mask length in the range of 0 to 32. You can use the ipv4-address and mask-length arguments together to specify a subnet. If you specify a subnet in this command, BGP tears down sessions to all dynamic peers in the subnet.
graceful graceful-time: Sets the time to wait before the device shuts down the session to the specified peer or peer group. The value range for the graceful-time argument is 0 to 65535 seconds. If you set the value for the graceful-time argument to 0, the device does not shut down the session to the specified peer or peer group. If you do not specify this option, the command immediately shuts down the session to the specified peer or peer group.
community { community-number | aa:nn }: Specifies the community attribute for advertised routes. The community-number argument represents the community sequence number in the range of 1 to 4294967295. The aa:nn argument represents the community number. Both aa and nn are in the range of 0 to 65535. If you do not specify this option, the command does not change the community attribute for advertised routes.
local-preference preference: Specifies the local preference for advertised routes, in the range of 0 to 4294967295. A larger value represents a higher preference. If you do not specify this option, the command does not change the local preference for advertised routes.
med med: Specifies the MED value for advertised routes, in the range of 0 to 4294967295. The smaller the MED value, the higher the route priority. If you do not specify this option, the command does not change the MED value for advertised routes.
ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.
prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a subnet. If you specify a subnet in this command, BGP tears down sessions to all dynamic peers in the subnet.
CAUTION: · If a session has been established to a peer, executing the peer ignore command for the peer tears down the session and clears all related routing information. · If sessions have been established to a peer group, executing the peer ignore command for the peer group tears down the sessions to all peers in the group and clears all related routing information. |
This command enables you to temporarily tear down the BGP session to a peer or peer group. You can perform network upgrade and maintenance without needing to delete and reconfigure the peer or peer group. To recover the session, execute the undo peer ignore command.
If you specify the graceful keyword in the peer ignore command, BGP performs the following tasks:
1. Starts the wait timer specified with the graceful keyword.
2. Advertises all routes to the specified peer or peer group and changes the attribute for the advertised routes to the specified value.
Advertises the routes from the specified peer or peer group to other IBGP peers and peer groups and changes the attribute for the advertised routes to the specified value.
3. Shuts down the session to the specified peer or peer group after the wait timer expires.
This configuration lowers the priority of the routes advertised by BGP and BGP peers can select other peers' routes as optimal routes, which avoids traffic interruption upon wait timer expiration or peer disconnection. To enable BGP to advertise low-priority routes without tearing down BGP sessions, you can set the value for the graceful graceful-time option to 0.
For a BGP peer or peer group, the configuration made by the peer ignore command takes precedence over the configuration made by the ignore all-peers command.
# In BGP instance view, disable session establishment with peer 1.1.1.1.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] peer 1.1.1.1 ignore
# In BGP instance view, configure BGP to gracefully shut down the session to peer 1.1.1.1 in 60 seconds, advertise all routes to peer 1.1.1.1, and change the community attribute and local preference for the advertised routes to 1:1 and 200, respectively.
<Sysname> system-view
[Sysname] bgp 1
[Sysname-bgp-default] peer 1.1.1.1 ignore graceful 60 community 1:1 local-preference 200
Related commands
ignore all-peers
peer keep-all-routes
Use peer keep-all-routes to save all route updates from a peer or peer group, regardless of whether the routes have passed the configured routing policy.
Use undo peer keep-all-routes to remove the configuration.
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } keep-all-routes
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } keep-all-routes
Route updates from a peer or peer group are not saved.
BGP IPv4 unicast address family view
BGP IPv6 unicast address family view
network-admin
group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.
ipv4-address: Specifies a peer by its IPv4 address. The peer must have been created.
mask-length: Specifies a mask length in the range of 0 to 32. You can use the ipv4-address and mask-length arguments together to specify a subnet. If you specify a subnet, this command saves all route updates from all dynamic peers in the subnet, regardless of whether the routes have passed the configured routing policy.
ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.
prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a subnet. If you specify a subnet, this command saves all route updates from all dynamic peers in the subnet, regardless of whether the routes have passed the configured routing policy.
To implement BGP session soft-reset when the local router and a peer or peer group do not support the route refresh feature, use the peer keep-all-routes command. The command saves all route updates received from the peer or peer group. After modifying the route selection policy, filter all saved routes with the new policy to refresh the routing table. This method avoids tearing down BGP sessions.
# In BGP IPv4 unicast address family view, save all route updates from peer 1.1.1.1.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] peer 1.1.1.1 keep-all-routes
peer capability-advertise route-refresh
peer low-memory-exempt
Use peer low-memory-exempt to configure BGP to protect EBGP peers or peer groups when the memory usage reaches level 2 threshold.
Use undo peer low-memory-exempt to remove the configuration.
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } low-memory-exempt
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } low-memory-exempt
When the memory usage reaches level 2 threshold, BGP tears down an EBGP session to release memory resources periodically.
network-admin
group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.
ipv4-address: Specifies a peer by its IPv4 address. The peer must have been created.
mask-length: Specifies a mask length in the range of 0 to 32. You can use the ipv4-address and mask-length arguments together to specify a subnet. If you specify a subnet in this command, BGP protects all dynamic peers in the subnet when the memory usage reaches level 2 threshold.
ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.
prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a subnet. If you specify a subnet in this command, BGP protects all dynamic peers in the subnet when the memory usage reaches level 2 threshold.
When level 2 memory usage threshold is reached, BGP tears down an EBGP session to release memory resources periodically until the memory usage is exempt from level 2 threshold. You can use this command to avoid tearing down the BGP session to an EBGP peer when memory usage reaches level 2 threshold. For more information about thresholds, see hardware resource management configuration in System Management Configuration Guide.
# In BGP instance view, configure BGP to protect EBGP peer 1.1.1.1 when the memory usage reaches level 2 threshold.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] peer 1.1.1.1 as-number 200
[Sysname-bgp-default] peer 1.1.1.1 low-memory-exempt
peer nexthop-recursive-policy disable
Use peer nexthop-recursive-policy disable to disable route recursion policy control for routes received from the specified peer or peer group.
Use undo peer nexthop-recursive-policy disable to remove the configuration.
Syntax
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } nexthop-recursive-policy disable
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } nexthop-recursive-policy disable
Default
The route recursion policy applies to routes received from the specified peer or peer group.
Views
BGP instance view
Predefined user roles
network-admin
Parameters
group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.
ipv4-address: Specifies a peer by its IPv4 address. The peer must have been created.
mask-length: Specifies a mask length in the range of 0 to 32. You can use the ipv4-address and mask-length arguments together to specify a subnet. If you specify a subnet, this command specifies all dynamic peers in the subnet.
ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.
prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a subnet. If you specify a subnet, this command specifies all dynamic peers in the subnet.
Usage guidelines
If you configure routing policy-based recursive lookup for BGP routes, this route recursion policy applies to BGP routes learned from all peers. This command allows you to disable route recursion policy control for routes learned from certain peers, for example, direct EBGP peers.
Examples
# In BGP instance view, disable route recursion policy control for routes received from peer 1.1.1.1.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] peer 1.1.1.1 as-number 200
[Sysname-bgp-default] peer 1.1.1.1 nexthop-recursive-policy disable
Related commands
protocol nexthop recursive-lookup
peer password
Use peer password to enable MD5 authentication for a BGP peer or peer group.
Use undo peer password to remove MD5 authentication for a BGP peer or peer group.
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } password { cipher | simple } password
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } password
MD5 authentication is disabled.
network-admin
group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.
ipv4-address: Specifies a peer by its IPv4 address. The peer must have been created.
mask-length: Specifies a mask length in the range of 0 to 32. You can use the ipv4-address and mask-length arguments together to specify a subnet. If you specify a subnet, this command enables MD5 authentication for all dynamic peers in the subnet.
ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.
prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a subnet. If you specify a subnet, this command enables MD5 authentication for all dynamic peers in the subnet.
cipher: Specifies a password in encrypted form.
simple: Specifies a password in plaintext form. For security purposes, the password specified in plaintext form will be stored in encrypted form.
password: Specifies the password. Its encrypted form is a case-sensitive string of 33 to 137 characters. Its plaintext form is a case-sensitive string of 1 to 80 characters.
You can enable MD5 authentication to enhance security using the following methods:
· Perform MD5 authentication when establishing TCP connections. Only the two parties that have the same password configured can establish TCP connections.
· Perform MD5 calculation on TCP segments to avoid modification to the encapsulated BGP packets.
# In BGP instance view, perform MD5 authentication on the TCP connection between local router 10.1.100.1 and peer router 10.1.100.2. Set the authentication password to aabbcc in plaintext form.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] peer 10.1.100.2 password simple aabbcc
peer soo
Use peer soo to configure the Site of Origin (SoO) attribute for a BGP peer or peer group.
Use undo peer soo to remove the configuration.
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } soo site-of-origin
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } soo
No SoO attribute is configured for a peer or peer group.
BGP IPv4 unicast address family view
BGP IPv6 unicast address family view
network-admin
group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.
ipv4-address: Specifies a peer by its IPv4 address. The peer must have been created.
mask-length: Specifies a mask length in the range of 0 to 32. You can use the ipv4-address and mask-length arguments together to specify a subnet. If you specify a subnet, this command configures the SoO attribute for all dynamic peers in the subnet.
ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.
prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a subnet. If you specify a subnet, this command configures the SoO attribute for all dynamic peers in the subnet.
site-of-origin: Specifies the SoO attribute, a string of 3 to 24 characters. The SoO attribute has the following formats:
· 16-bit AS number:32-bit user-defined number. For example, 100:3.
· 32-bit IP address:16-bit user-defined number. For example, 192.168.122.15:1.
· 32-bit AS number:16-bit user-defined number, where the minimum value of the AS number is 65536. For example, 65536:1.
· 32-bit IP address/IPv4 address mask length:16-bit user-defined number. For example, 192.168.122.15/24:1.
· 32-bit AS number in dotted format:16-bit user-defined number. For example, 65535.65535:1.
The SoO attribute specifies the site where the route was originated. It prevents advertising a route back to the originating site. If the AS-path attribute is lost, the router can use the SoO attribute to avoid routing loops.
After you configure the SoO attribute for a BGP peer or peer group, BGP adds the SoO attribute into the route updates received from the BGP peer or peer group. Before advertising route updates to the peer or peer group, BGP checks the SoO attribute of the route update against the configured SoO attribute. If they are the same, BGP does not advertise the route updates to the BGP peer or peer group to avoid loops.
If a PE configured with AS number substitution connects to multiple CEs in the same VPN site through different interfaces, routing loops will occur. To avoid routing loops, configure the same SoO attribute for the CEs on the PE.
# In BGP IPv4 unicast address family view, set the SoO attribute to 100:1 for peer 1.1.1.1.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4
[Sysname-bgp-default-ipv4] peer 1.1.1.1 soo 100:1
peer substitute-as
peer tcp-mss
Use peer tcp-mss to set the TCP maximum segment size (MSS) for a peer or peer group.
Use undo peer tcp-mss to restore the default.
Syntax
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } tcp-mss mss-value
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } tcp-mss
Default
The TCP MSS is not set.
Views
BGP instance view
Predefined user roles
network-admin
Parameters
group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.
ipv4-address: Specifies a peer by its IPv4 address. The peer must have been created.
mask-length: Specifies a mask length in the range of 0 to 32. If you use the ipv4-address and mask-length arguments together to specify a subnet, this command applies to all dynamic peers in the subnet.
ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.
prefix-length: Specifies a prefix length in the range of 0 to 128. If you use the ipv6-address and prefix-length arguments together to specify a subnet, this command applies to all dynamic peers in the subnet.
mss-value: Specifies the TCP MSS in bytes. The value range for this argument is 176 to 4096.
Usage guidelines
BGP typically establishes a multihop TCP connection with a peer. Multiple intermediate devices might fragment BGP packets due to their MTU settings, resulting in frequent packet encapsulations and decapsulations that reduce forwarding efficiency.
To resolve this issue, you can execute this command to set the TCP MSS for a peer or peer group. TCP segments sent by the source will not be re-fragmented along the path to the destination.
This command might cause BGP session re-establishment. Make sure you understand the potential impact before executing this command.
During TCP connection establishment with the peer or peer group specified in the peer tcp-mss command, the minimum of the following MSSs takes effect:
· The MSS calculated according to the IPv4 MTU set by the ip mtu command on the peer-facing interface.
· The MSS set by the tcp mss command for the peer-facing interface.
· The MSS calculated according to the path MTU detected by TCP path MTU discovery (enabled with the tcp path-mtu-discovery command).
· The MSS set by the peer tcp-mss command.
The MSS is calculated by using the following formula:
MSS = path MTU (or interface MTU) – IP header length – TCP header length
For more information about MTU and MSS, see IP performance optimization configuration in Layer 3—IP Services Configuration Guide.
Examples
# Set the TCP MSS to 500 for peer group test.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] peer test tcp-mss 500
Warning:This operation might reset the peer session. Continue? [Y/N]:
Related commands
tcp path-mtu-discovery (Layer 3—IP Services Command Reference)
pic
Use pic to enable BGP FRR for a BGP address family.
Use undo pic to disable BGP FRR for a BGP address family.
pic
undo pic
BGP FRR is disabled.
BGP IPv4 unicast address family view
BGP IPv6 unicast address family view
network-admin
FRR is used in a dual-homing network to protect a primary route with a backup route. It uses ARP (for IPv4), ND (for IPv6), or echo-mode BFD (for IPv4) to detect the connectivity of the primary route. When the primary route fails, BGP directs packets to the backup route.
After you enable FRR, BGP calculates a backup route for each BGP route in the address family if there are two or more unequal-cost routes to reach the destination.
You can also configure BGP FRR by using the fast-reroute route-policy command, which takes precedence over the pic command. For more information about routing policies, see Layer 3—IP Routing Configuration Guide.
Use the pic command with caution because it might cause routing loops in specific scenarios.
# Enable BGP FRR in BGP IPv4 unicast address family view.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] pic
primary-path-detect bfd
Use primary-path-detect bfd to configure BGP FRR to use BFD to detect next hop connectivity for the primary route.
Use undo primary-path-detect bfd to restore the default.
primary-path-detect bfd { ctrl | echo }
undo primary-path-detect bfd
BGP FRR uses ARP to detect the connectivity to the next hop of the primary route.
network-admin
ctrl: Uses control-mode BFD to detect the connectivity to the next hop of the primary route.
echo: Uses echo-mode BFD to detect the connectivity to the next hop of the primary route.
Usage guidelines
This command enables BGP to create an IP FRR BFD session that detects next hop connectivity for the primary route. This can speed up primary and backup route switchover when the next hop of the primary route fails.
This command takes effect and creates an IP FRR BFD session only when the primary route has a backup next hop.
BGP does not support backup next hop calculation for the routes used for load balancing. This command cannot take effect when the primary route is an ECMP route. To resolve this issue, use the primary-path-detect bfd protocol-ecmp bgp command or the primary-path-detect bfd protocol-ecmp bgp4+ command. For more information about the two commands, see basic IP routing commands in Layer 3—IP Routing Command Reference.
· Configure the primary-path-detect bfd command on the peer device in the primary link.
This task is applicable when both ends of the primary link are configured with FRR.
· Manually configure a static BFD session that uses the following settings on the peer device in the primary link:
¡ Source IP address: Destination IP address of the BFD session automatically created on the local device in the primary link.
¡ Destination IP address: Source IP address of the BFD session automatically created on the local device in the primary link.
¡ Remote ID: Local ID of the BFD session automatically created on the local device in the primary link.
When another routing protocol (such as OSPF or IS-IS) uses BFD to detect next hop connectivity for the primary route, it also creates a BFD session. If the detected link is the same as the link attached to the next hop of the BGP primary route, BGP reuses the BFD session created by the protocol. In this situation, BGP will not create an additional BFD session.
If you execute this command multiple times, the most recent configuration takes effect.
# In BGP instance view, configure BGP FRR to use echo-mode BFD to detect next hop connectivity for the primary route.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] primary-path-detect bfd echo
fast-reroute route-policy
pic
primary-path-detect bfd (Layer 3—IP Routing Command Reference)
refresh bgp
Use refresh bgp to manually soft-reset BGP sessions.
Syntax
refresh bgp [ instance instance-name ] { ipv4-address [ mask-length ] | all | external | group group-name | internal } { export | import } ipv4 [ unicast ]
refresh bgp [ instance instance-name ] ipv6-address [ mask-length ] { export | import } ipv4 [ unicast ]
refresh bgp [ instance instance-name ] { ipv6-address [ prefix-length ] | all | external | group group-name | internal } { export | import } ipv6 [ unicast ]
refresh bgp [ instance instance-name ] ipv4-address [ mask-length ] { export | import } ipv6 [ unicast ]
refresh bgp [ instance instance-name ] { ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] | all | external | group group-name | internal } { export | import } link-state
Views
User view
Predefined user roles
network-admin
Parameters
instance instance-name: Specifies a BGP instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify this option, the command soft-resets BGP sessions for the default BGP instance.
ipv4-address: Soft-resets the BGP session to a peer specified by its IP address.
mask-length: Specifies a mask length in the range of 0 to 32. You can use the ipv4-address and mask-length arguments together to specify a subnet. If you specify a subnet, this command soft-resets BGP sessions to all dynamic peers in the subnet.
ipv6-address: Soft-resets the BGP session to a peer specified by its IPv6 address.
prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a subnet. If you specify a subnet, this command soft-resets BGP sessions to all dynamic peers in the subnet.
all: Soft-resets all BGP sessions.
external: Soft-resets all EBGP sessions.
group group-name: Soft-resets the BGP sessions to the peers of the specified peer group. The group-name argument refers to the name of a peer group, a case-sensitive string of 1 to 47 characters.
internal: Soft-resets all IBGP sessions.
export: Performs outbound soft-reset (filters routes advertised to the specified peer or peer group by using the new configuration).
import: Performs inbound soft-reset (filters routes received from the specified peer or peer group by using the new configuration).
ipv4: Soft-resets BGP sessions for IPv4 address family.
ipv6: Soft-resets BGP sessions for IPv6 address family.
link-state: Soft-resets BGP sessions for LS address family.
unicast: Soft-resets BGP sessions for unicast address family.
Usage guidelines
A soft-reset operation enables the router to apply a new route selection policy without tearing down BGP connections.
To apply a new policy to outbound BGP sessions, execute this command with the export keyword. The router uses the new policy to filter routing information and sends the routing information that passes the filtering to the BGP peers.
To apply a new policy to inbound sessions, execute this command with the import keyword. The router advertises a route-refresh message to the peer and the peer resends its routing information to the router. After receiving the routing information, the router uses the new policy to filter the routing information.
This command requires that both the local router and the peer support route refresh.
If the peer keep-all-routes command is configured, the refresh bgp import command does not take effect.
By default, the unicast keyword is used if you do not specify the unicast keyword.
Examples
# Soft-reset all inbound BGP sessions for the IPv4 unicast address family.
<Sysname> refresh bgp all import ipv4
Related commands
peer capability-advertise route-refresh
peer keep-all-routes
route-select delay
Use route-select delay to configure optimal route selection delay.
Use undo route-select delay to restore the default.
Syntax
route-select delay delay-value
undo route-select delay
Default
The optimal route selection delay timer is 0 seconds, which means optimal route selection is not delayed.
Views
BGP IPv4 unicast address family view
BGP IPv6 unicast address family view
BGP LS address family view
Predefined user roles
network-admin
Parameters
delay-value: Specifies the optimal route selection delay timer in the range of 0 to 600 seconds. A value of 0 means optimal route selection is not delayed.
Usage guidelines
To avoid packet loss caused by path switchover, configure this command to delay optimal route selection upon a route change.
Follow these restrictions and guidelines when you configure the command:
· The optimal route selection delay setting applies only when multiple effective routes with the same prefix exist after a route change occurs.
· For routes being delayed for optimal route selection, modifying the optimal route selection delay timer has the following effects:
¡ If you modify the delay timer to a non-zero value, the routes are not affected, and they still use the original delay timer.
¡ If you execute the undo form of the command or modify the delay timer to 0, the device performs optimal route selection immediately.
· If you execute the command multiple times for an address family, the most recent configuration takes effect.
· The optimal route selection delay configuration does not apply to the following conditions:
¡ A route change is caused by execution of a command or by route withdrawal.
¡ After a route change occurs, only one route exists for a specific destination network.
¡ An active/standby process switchover occurs.
¡ A route change occurs among equal-cost routes.
¡ Only the optimal and suboptimal routes exist when FRR is configured.
¡ Optimal route selection is triggered by a redistributed route.
¡ The next hop of the optimal route changes and a route with the same prefix is waiting for the delay timer to expire.
Examples
# In BGP IPv4 unicast address family view, set the optimal route selection delay timer to 100 seconds.
<Sysname> system-view
[Sysname] bgp 65009
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] route-select delay 100
shutdown process
Use shutdown process to shut down BGP sessions to all peers and peer groups.
Use undo shutdown process to restore the default.
Syntax
shutdown process
undo shutdown process
Default
BGP does not shut down sessions to any peers or peer groups.
Views
BGP instance view
Predefined user roles
network-admin
Usage guidelines
For maintenance purposes, you can execute this command to temporarily disconnect BGP sessions from all peers and peer groups on the device. After maintenance, you can restore the sessions by simply executing the undo form of the command without reconfiguring peer or peer group settings.
This command enables the device to tear down all sessions and clear all routing information.
When you configure the shutdown process command together with the peer ignore or ignore all-peers command, follow these restrictions and guidelines:
· Once BGP shutdown is enabled by the shutdown process command, the device cannot establish BGP sessions with all peers and peer groups.
· To disable BGP session establishment with a peer or peer group if you have disabled BGP shutdown, perform one of the following tasks:
¡ Disable BGP session establishment with that peer or peer group by using the peer ignore command.
¡ Disable BGP session establishment with all peers and peer groups by using the ignore all-peers command.
Examples
# Shut down BGP sessions to all peers and peer groups for BGP instance 100.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] shutdown process