- Table of Contents
-
- 08-Layer 3—IP Routing Command Reference
- 00-Preface
- 01-Basic IP routing commands
- 02-Static routing commands
- 03-IPv6 static routing commands
- 04-RIP commands
- 05-RIPng commands
- 06-OSPF commands
- 07-OSPFv3 commands
- 08-BGP commands
- 09-Policy-based routing commands
- 10-IPv6 policy-based routing commands
- 11-Routing policy commands
- 12-Guard route commands
- Related Documents
-
Title | Size | Download |
---|---|---|
08-BGP commands | 914.01 KB |
bgp update-delay on-startup prefix-list
display bgp dampening parameter
display bgp non-stop-routing status
display bgp routing-table dampened
display bgp routing-table flap-info
display bgp routing-table ipv4 multicast
display bgp routing-table ipv4 rtfilter
display bgp routing-table ipv4 unicast
display bgp routing-table ipv6 multicast
display bgp routing-table ipv6 unicast
display bgp routing-table ipv6 unicast inlabel
display bgp routing-table ipv6 unicast outlabel
graceful-restart timer purge-time
graceful-restart timer restart
graceful-restart timer wait-for-rib
ip vpn-instance (BGP instance view)
peer advertise-policy exist-policy
peer advertise-policy non-exist-policy
peer as-number (for a BGP peer group)
peer as-number (for a BGP peer)
peer capability-advertise conventional
peer capability-advertise route-refresh
peer capability-advertise suppress-4-byte-as
router-id (BGP-VPN instance view)
unicast-route recursive-lookup tunnel
BGP commands
address-family ipv4
Use address-family ipv4 to create the BGP IPv4 unicast address family, BGP-VPN IPv4 unicast address family, BGP IPv4 RT filter address family, or BGP IPv4 multicast address family, and enter its view, or enter the view of the existing address family.
Use undo address-family ipv4 to remove the BGP IPv4 unicast address family, BGP-VPN IPv4 unicast address family, BGP IPv4 RT filter address family, or BGP IPv4 multicast address family, and all its configurations.
In BGP instance view:
address-family ipv4 [ multicast | rtfilter | unicast ]
undo address-family ipv4 [ multicast | rtfilter | unicast ]
In BGP-VPN instance view:
address-family ipv4 [ unicast ]
undo address-family ipv4 [ unicast ]
No BGP IPv4 unicast address family, BGP-VPN IPv4 unicast address family, BGP IPv4 RT filter address family, or BGP IPv4 multicast address family exists.
BGP-VPN instance view
network-admin
multicast: Specifies the IPv4 multicast address family.
rtfilter: Specifies the BGP IPv4 RT filter address family.
unicast: Specifies the IPv4 unicast address family. If this command is executed with the unicast keyword in BGP instance view, it places you into BGP IPv4 unicast address family view. If this command is executed with the unicast keyword in BGP-VPN instance view, it places you into BGP-VPN IPv4 unicast address family view.
Configurations made in BGP IPv4 unicast address family view apply only to the BGP IPv4 unicast routes and peers of the public network.
Configurations made in BGP-VPN IPv4 unicast address family view apply only to the BGP IPv4 unicast routes and peers of the specified VPN instance.
Configurations made in BGP IPv4 multicast address family view apply only to the BGP IPv4 multicast routes and peers.
Configurations made in BGP IPv4 RT filter address family view apply only to the BGP IPv4 RT filter routes and peers.
By default, the unicast keyword is used if you do not specify the multicast, rtfilter, or unicast keyword.
# In BGP instance view, create the BGP IPv4 unicast address family and enter its view.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4]
address-family ipv6
Use address-family ipv6 to create the BGP IPv6 unicast address family, BGP-VPN IPv6 unicast address family, or BGP IPv6 multicast address family, and enter its view, or enter the view of the existing address family.
Use undo address-family ipv6 to remove the BGP IPv6 unicast address family, BGP-VPN IPv6 unicast address family, or BGP IPv6 multicast address family, and all its configurations.
In BGP instance view:
address-family ipv6 [ multicast | unicast ]
undo address-family ipv6 [ multicast | unicast ]
In BGP-VPN instance view:
address-family ipv6 [ unicast ]
undo address-family ipv6 [ unicast ]
No BGP IPv6 unicast address family, BGP-VPN IPv6 unicast address family, or BGP IPv6 multicast address family exists.
BGP-VPN instance view
network-admin
unicast: Specifies the IPv6 unicast address family. If this command is executed with the unicast keyword in BGP instance view, it places you into BGP IPv6 unicast address family view. If this command is executed with the unicast keyword in BGP-VPN instance view, it places you into BGP-VPN IPv6 unicast address family view.
multicast: Specifies the IPv6 multicast address family.
Configurations made in BGP IPv6 unicast address family view apply only to the BGP IPv6 unicast routes and peers of the public network.
Configurations made in BGP-VPN IPv6 unicast address family view apply only to the BGP IPv6 unicast routes and peers of the specified VPN instance.
Configurations made in BGP IPv6 multicast address family view apply only to the BGP IPv6 multicast routes and peers.
By default, the unicast keyword is used if neither the multicast keyword nor the unicast keyword is specified.
# In BGP instance view, create the BGP IPv6 unicast address family and enter its view.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv6 unicast
[Sysname-bgp-default-ipv6]
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]
advertise-rib-active
Use advertise-rib-active to enable BGP to advertise only the optimal BGP routes in the IP routing table.
Use undo advertise-rib-active to restore the default.
advertise-rib-active
undo advertise-rib-active
In BGP instance view, BGP advertises optimal routes in the BGP routing table, regardless of whether they are optimal in the IP routing table. In other views, the setting is the same as that in BGP instance view.
BGP IPv4 unicast address family view
BGP-VPN IPv4 unicast address family view
BGP IPv6 unicast address family view
BGP-VPN IPv6 unicast address family view
network-admin
The advertise-rib-active command does not apply to the following routes:
· Routes redistributed by the import-route command.
· Routes advertised by the network command.
· Default routes redistributed by the default-route imported command.
· VPNv4 routes.
· VPNv6 routes.
· IPv4 multicast routes.
· IPv6 multicast routes.
This command takes effect only on the routes generated after you execute this command. To apply this command to existing routes, use the reset bgp command to reset BGP sessions.
The setting in BGP unicast address family view applies when it is different from that in BGP instance view.
# In BGP instance view, enable BGP to advertise optimal routes in the IP routing table.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] advertise-rib-active
aggregate
Use aggregate to create a summary route in the BGP routing table.
Use undo aggregate to remove a summary route.
In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view/BGP IPv4 multicast address family view:
aggregate ipv4-address { mask-length | mask } [ as-set | attribute-policy route-policy-name | detail-suppressed | origin-policy route-policy-name | suppress-policy route-policy-name ] *
undo aggregate ipv4-address { mask-length | mask }
In BGP IPv6 unicast address family view/BGP-VPN IPv6 unicast address family view/BGP IPv6 multicast address family view:
aggregate ipv6-address prefix-length [ as-set | attribute-policy route-policy-name | detail-suppressed | origin-policy route-policy-name | suppress-policy route-policy-name ] *
undo aggregate ipv6-address prefix-length
No summary routes are configured.
BGP IPv4 unicast address family view
BGP-VPN IPv4 unicast address family view
BGP IPv6 unicast address family view
BGP-VPN IPv6 unicast address family view
BGP IPv4 multicast address family view
BGP IPv6 multicast address family view
network-admin
ipv4-address: Specifies an IPv4 summary address.
mask-length: Specifies a mask length for the IPv4 summary address, in the range of 0 to 32.
mask: Specifies a mask for the IPv4 summary address, in dotted decimal notation.
ipv6-address: Specifies an IPv6 summary address.
prefix-length: Specifies a prefix length for the IPv6 summary address, in the range of 0 to 128.
as-set: Enables the AS_PATH attribute of the summary route to contain the AS path information for all summarized routes. The AS_PATH attribute is of the AS_SET type that requires no sequence when arranging AS numbers. If you do not specify this keyword, the AS_PATH attribute of the summary route contains only the AS number of the local router.
attribute-policy route-policy-name: Specifies a routing policy by its name, a case-sensitive string of 1 to 63 characters, to set attributes for the summary route.
detail-suppressed: Advertises only the summary route. If you do not specify this keyword, BGP advertises both the summary route and the more specific routes.
origin-policy route-policy-name: Specifies a routing policy by its name, a case-sensitive string of 1 to 63 characters, to select routes to be summarized.
suppress-policy route-policy-name: Specifies a routing policy by its name, a case-sensitive string of 1 to 63 characters, to filter more specific routes to be advertised. Routes permitted by the specified routing policy are not advertised. Routes denied by the specified routing policy are advertised.
This command creates a summary route. If the BGP routing table has routes whose destination addresses fall within the specified network, the summary route is added to the BGP routing table. For example, if two routes 10.1.1.0/24 and 10.1.2.0/24 exist in the BGP routing table, configuring the aggregate 10.1.0.0 16 command creates a summary route 10.1.0.0/16.
If the summarized routes have different ORIGIN attributes, the summary route selects the ORIGIN attribute in the sequence of INCOMPLETE, EGP, and IGP. For example, if the ORIGIN attributes of the summarized routes include INCOMPLETE and IGP, the ORIGIN attribute of the summary route is INCOMPLETE.
The COMMUNITY attribute of the summary route includes all the COMMUNITY (or extended community) attribute values if the routes have the following details:
· Summarized routes have different COMMUNITY (or extended community) attribute values.
· The summary route does not have the ATOMIC_AGGREGATE attribute.
Table 1 Functions of the keywords
Keywords |
Function |
as-set |
Enables the summary route to carry the AS path information for all summarized routes. This feature can help avoid routing loops. However, if many routes are summarized and are changed frequently, do not specify this keyword. This configuration causes the summary route to flap with the more specific routes. |
attribute-policy |
Sets attributes except the AS-PATH attribute for the summary route. The peer route-policy command can achieve the same purpose. |
detail-suppressed |
Disables advertisement of all more specific routes. To disable advertisement of some more specific routes, use the suppress-policy keyword or the peer filter-policy command. |
origin-policy |
Summarizes only routes matching a routing policy. If the destination address of a route falls within the summary network but does not match the routing policy, the route is not summarized. It is not controlled by the detail-suppressed and suppress-policy keywords. There is no need to configure apply clauses for the routing policy applied by the origin-policy keyword because they do not take effect. |
suppress-policy |
Disables advertisement of some more specific routes filtered by a routing policy. The routing policy uses if-match clauses to filter routes. There is no need to configure apply clauses for the routing policy applied by the suppress-policy keyword because they do not take effect. |
# In BGP IPv4 unicast address family view, create summary route 1.1.0.0/16 in the BGP routing table.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] aggregate 1.1.0.0 255.255.0.0
display bgp routing-table ipv4 multicast
display bgp routing-table ipv4 unicast
display bgp routing-table ipv6 multicast
display bgp routing-table ipv6 unicast
summary automatic
balance
Use balance to enable load balancing and set the maximum number of BGP ECMP routes for load balancing.
Use undo balance to disable load balancing.
balance [ ebgp | eibgp | ibgp ] number
undo balance [ ebgp | eibgp | ibgp ]
Load balancing is disabled.
BGP IPv4 unicast address family view
BGP-VPN IPv4 unicast address family view
BGP IPv6 unicast address family view
BGP-VPN IPv6 unicast address family view
BGP IPv4 multicast address family view
BGP IPv6 multicast address family view
network-admin
ebgp: Enables load balancing over EBGP routes.
eibgp: Enables load balancing between EBGP and IBGP routes.
ibgp: Enables load balancing over IBGP routes.
number: Specifies the maximum number of BGP ECMP routes for load balancing. When it is set to 1, load balancing is disabled.
Unlike IGP, BGP has no explicit metric for making load balancing decision. Instead, it implements load balancing by modifying route selection rules.
If multiple BGP routes destined for a network meet the following conditions, the device selects the specified number of routes for load balancing:
BGP uses the following load balancing criteria to determine load balanced routes:
· The routes have the same ORIGIN, LOCAL_PREF, and MED attributes.
· The routes meet the following requirements on the AS_PATH attribute:
¡ If the balance as-path-neglect command is configured, the routes can have different AS_PATH attributes.
¡ If only the balance as-path-relax command is configured, the routes can have different AS_PATH attributes, but the length of the AS_PATH attributes must be the same.
¡ If neither the balance as-path-neglect nor the balance as-path-relax command is configured, the routes must have the same AS_PATH attribute.
· The next hops of the routes meet the following requirements on IGP metrics:
¡ If the bestroute igp-metric-ignore command is not configured, the next hops of the routes must have the same IGP metric value.
¡ If the bestroute igp-metric-ignore command is configured, the next hops of the routes can have different IGP metric values.
The value range for the number argument depends on the max-ecmp-num command. If you set the maximum number of ECMP routes to m by using the max-ecmp-num command and reboot the device, the number argument in the balance command is in the range of 1 to m.
If you do not specify the ibgp, eibgp, or ebgp keyword, this command enables load balancing over EBGP routes and IBGP routes, but not between EBGP and IBGP routes.
You can remove the configuration of the balance eibgp number command only by executing the undo balance eibgp command.
After you execute the balance eibgp number command, the balance [ ebgp | ibgp ] number command cannot be executed; and vice versa.
# In BGP IPv4 unicast address family view, enable load balancing and set the maximum number of BGP ECMP routes used for load balancing to 2.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] balance 2
balance as-path-neglect
balance as-path-relax
bestroute igp-metric-ignore
balance as-path-neglect
Use balance as-path-neglect to enable BGP to ignore the AS_PATH attribute when it implements load balancing.
Use undo balance as-path-neglect to restore the default.
balance as-path-neglect
undo balance as-path-neglect
BGP does not ignore the AS_PATH attribute when it implements load balancing.
BGP IPv4 unicast address family view
BGP-VPN IPv4 unicast address family view
BGP IPv6 unicast address family view
BGP-VPN IPv6 unicast address family view
BGP IPv4 multicast address family view
BGP IPv6 multicast address family view
network-admin
For BGP to implement load balancing over routes with different AS_PATH attributes, you must use this command together with the balance command.
After this command is executed, BGP ignores the AS_PATH attributes in the routes for load balancing and changes the attributes of the advertised routes to those of the optimal route. The operations might cause routing loops. In addition, this command might also affect the NetStream data. Therefore, use this command with caution.
# In BGP IPv4 unicast address family view, enable BGP to ignore the AS_PATH attribute when it implements load balancing.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] balance as-path-neglect
balance
balance as-path-relax
Use balance as-path-relax to enable load balancing for routes that have different AS_PATH attributes of the same length.
Use undo balance as-path-relax to restore the default.
Syntax
balance as-path-relax
undo balance as-path-relax
Default
BGP cannot perform load balancing for routes that have different AS_PATH attributes of the same length.
Views
BGP IPv4 unicast address family view
BGP-VPN IPv4 unicast address family view
BGP IPv6 unicast address family view
BGP-VPN IPv6 unicast address family view
BGP IPv4 multicast address family view
BGP IPv6 multicast address family view
Predefined user roles
network-admin
Usage guidelines
For BGP to perform load balancing for routes with different AS_PATH attributes of the same length, you must use this command together with the balance command.
If you configure both the balance as-path-relax and balance as-path-neglect commands, the balance as-path-neglect command takes effect.
After this command is executed, BGP ignores the AS_PATH attributes in the routes for load balancing and changes the attributes of the advertised routes to those of the optimal route. This might cause routing loops and affect NetStream statistics. Therefore, use this command with caution.
Examples
# In BGP IPv4 unicast address family view, enable load balancing for routes that have different AS_PATH attributes of the same length.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] balance as-path-relax
bestroute as-path-neglect
Use bestroute as-path-neglect to configure BGP to ignore the AS_PATH attribute during optimal route selection.
Use undo bestroute as-path-neglect to restore the default.
In BGP instance view:
bestroute as-path-neglect [ all-instance ]
undo bestroute as-path-neglect [ all-instance ]
In BGP-VPN instance view:
bestroute as-path-neglect
undo bestroute as-path-neglect
BGP considers the AS_PATH attribute during optimal route selection.
BGP-VPN instance view
network-admin
all-instance: Enables this feature for the BGP instance and all BGP-VPN instances created in the BGP instance. If you do not specify this keyword, the command enables this feature for only the BGP instance or BGP-VPN instance.
Usage guidelines
If you do not specify the all-instance keyword for this command, this feature is enabled for only the current BGP instance or BGP-VPN instance.
After executing the bestroute as-path-neglect all-instance command in BGP instance view, you enable this feature for the BGP instance and all BGP-VPN instances in the BGP instance. Executing the undo bestroute as-path-neglect command in BGP instance view or BGP-VPN instance view cannot disable this feature. To enable this feature for a specific instance, execute the bestroute as-path-neglect command in BGP instance or BGP-VPN instance view and make sure the bestroute as-path-neglect all-instance command is not executed in BGP instance view.
Examples
# In BGP instance view, ignore AS_PATH during optimal route selection.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] bestroute as-path-neglect
bestroute compare-med
Use bestroute compare-med to enable MED comparison for routes on a per-AS basis.
Use undo bestroute compare-med to restore the default.
In BGP instance view:
bestroute compare-med [ all-instance ]
undo bestroute compare-med [ all-instance ]
In BGP-VPN instance view:
bestroute compare-med
undo bestroute compare-med
MED comparison for routes on a per-AS basis is disabled.
BGP-VPN instance view
network-admin
all-instance: Enables this feature for the BGP instance and all BGP-VPN instances created in the BGP instance. If you do not specify this keyword, the command enables this feature for only the BGP instance or BGP-VPN instance.
Usage guidelines
By default, BGP does not compare MEDs for routes from the same AS. When a router learns a new route, it compares the route with the optimal route in its BGP routing table. If the new route is more optimal, it becomes the optimal route in the BGP routing table. In this way, route learning sequence might affect optimal route selection.
To solve the selection problem, the router puts routes received from the same AS into a group when the bestroute compare-med command is configured. The router then selects the route with the lowest MED from the same group, and compares routes from different groups.
If you do not specify the all-instance keyword for this command, this feature is enabled for only the current BGP instance or BGP-VPN instance.
After executing the bestroute compare-med all-instance command in BGP instance view, you enable this feature for the BGP instance and all BGP-VPN instances in the BGP instance. Executing the undo bestroute compare-med command in BGP instance view or BGP-VPN instance view cannot disable this feature. To enable this feature for a specific instance, execute the bestroute compare-med command in BGP instance or BGP-VPN instance view and make sure the bestroute compare-med all-instance command is not executed in BGP instance view.
# In BGP instance view, enable MED comparison for routes on a per-AS basis.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] bestroute compare-med
bestroute igp-metric-ignore
Use bestroute igp-metric-ignore to configure BGP to ignore IGP metrics during optimal route selection.
Use undo bestroute igp-metric-ignore to restore the default.
In BGP instance view:
bestroute igp-metric-ignore [ all-instance ]
undo bestroute igp-metric-ignore [ all-instance ]
In BGP-VPN instance view:
bestroute igp-metric-ignore
undo bestroute igp-metric-ignore
BGP considers IGP metrics during optimal route selection, and selects the route with the smallest IGP metric as the optimal route.
BGP-VPN instance view
network-admin
all-instance: Enables this feature for the BGP instance and all BGP-VPN instances created in the BGP instance. If you do not specify this keyword, the command enables this feature for only the BGP instance or BGP-VPN instance.
Usage guidelines
After executing the bestroute igp-metric-ignore all-instance command in BGP instance view, you enable this feature for the BGP instance and all BGP-VPN instances in the BGP instance. Executing the undo bestroute igp-metric-ignore command in BGP instance view or BGP-VPN instance view cannot disable this feature. To enable this feature for a specific instance, execute the bestroute igp-metric-ignore command in BGP instance or BGP-VPN instance view and make sure the bestroute igp-metric-ignore all-instance command is not executed in BGP instance view.
Examples
# In BGP instance view, ignore IGP metrics during optimal route selection.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] bestroute igp-metric-ignore
bestroute med-confederation
Use bestroute med-confederation to enable MED comparison for routes received from confederation peers.
Use undo bestroute med-confederation to restore the default.
In BGP instance view:
bestroute med-confederation [ all-instance ]
undo bestroute med-confederation [ all-instance ]
In BGP-VPN instance view:
bestroute med-confederation
undo bestroute med-confederation
MED comparison is disabled for routes received from confederation peers.
BGP-VPN instance view
network-admin
all-instance: Enables this feature for the BGP instance and all BGP-VPN instances created in the BGP instance. If you do not specify this keyword, the command enables this feature for only the BGP instance or BGP-VPN instance.
Usage guidelines
This command enables BGP to compare the MEDs of routes received from confederation peers. However, if a route from a confederation peer has an AS number that does not belong to the confederation, BGP does not compare the route with other routes. For example, a confederation has three AS numbers 65006, 65007, and 65009. BGP receives three routes from different confederation peers. The AS_PATH attributes of these routes are 65006 65009, 65007 65009, and 65008 65009, and the MED values of them are 2, 3, and 1. Because the third route's AS_PATH attribute contains AS number 65008, which does not belong to the confederation, BGP does not compare it with other routes. As a result, the first route becomes the optimal route.
After executing the bestroute med-confederation all-instance command in BGP instance view, you enable this feature for the BGP instance and all BGP-VPN instances in the BGP instance. Executing the undo bestroute med-confederation command in BGP instance view or BGP-VPN instance view cannot disable this feature. To enable this feature for a specific instance, execute the bestroute med-confederation command in BGP instance or BGP-VPN instance view and make sure the bestroute med-confederation all-instance command is not executed in BGP instance view.
# In BGP instance view, enable MED comparison for routes received from confederation peers.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] bestroute med-confederation
bestroute router-id-ignore
Use bestroute router-id-ignore to enable BGP to ignore router IDs during optimal route selection.
Use undo bestroute router-id-ignore to restore the default.
Syntax
In BGP instance view:
bestroute router-id-ignore [ all-instance ]
undo bestroute router-id-ignore [ all-instance ]
In BGP-VPN instance view:
bestroute router-id-ignore
undo bestroute router-id-ignore
Default
BGP compares router IDs during optimal route selection. If multiple routes to the same destination are available, BGP selects the route with the smallest router ID as the optimal route.
Views
BGP instance view
BGP-VPN instance view
Predefined user roles
network-admin
Parameters
all-instance: Enables this feature for the BGP instance and all BGP-VPN instances created in the BGP instance. If you do not specify this keyword, the command enables this feature for only the BGP instance or BGP-VPN instance.
Usage guidelines
After executing the bestroute router-id-ignore all-instance command in BGP instance view, you enable this feature for the BGP instance and all BGP-VPN instances in the BGP instance. Executing the undo bestroute router-id-ignore command in BGP instance view or BGP-VPN instance view cannot disable this feature. To enable this feature for a specific instance, execute the bestroute router-id-ignore command in BGP instance or BGP-VPN instance view and make sure the bestroute router-id-ignore all-instance command is not executed in BGP instance view.
Examples
# In BGP instance view, enable BGP to ignore router IDs during optimal route selection.
<Sysname> system-view
[Sysname] bgp 1
[Sysname-bgp-default] bestroute router-id-ignore
bgp
Use bgp to enable a BGP instance and enter its view.
Use undo bgp to disable a BGP instance.
bgp as-number [ instance instance-name ]
undo bgp [ as-number [ instance instance-name ] ]
BGP is disabled and no BGP instances exist.
network-admin
as-number: Specifies a local AS by its number in the range of 1 to 4294967295.
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 enables the BGP instance default.
A router supports 4-byte AS number.
A BGP router can run multiple BGP processes. Each BGP process corresponds to a BGP instance. BGP maintains an independent routing table for each BGP instance.
You can create multiple public address families for a BGP instance. However, each public address family (except for public VPNv4 address family and public VPNv6 address family) can belong to only one BGP instance.
You can create multiple VPN instances for a BGP instance, and each VPN instance can have multiple address families. A VPN instance can belong to only one BGP instance.
You cannot specify the same peer for the same address family of different BGP instances.
The IPv4 and IPv6 multicast address families must belong to the same BGP instance.
Different BGP instances can have the same AS number but cannot have the same name.
# Enable BGP instance default, set the local AS number to 100, and enter BGP instance view.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default]
bgp update-delay on-startup
Use bgp update-delay on-startup to configure BGP to delay sending route updates on reboot.
Use undo bgp update-delay on-startup to restore the default.
bgp update-delay on-startup seconds
undo bgp update-delay on-startup
BGP sends route updates immediately on reboot.
network-admin
seconds: Specifies the delay time in the range of 0 to 3600 seconds. The value of 0 indicates that BGP does not send route updates after the device reboots.
After you execute this command, BGP redistributes all routes from other neighbors on reboot, selects the optimal route, and then advertises it. Using this command can reduce traffic loss caused by reboot.
# In BGP instance view, configure BGP to delay sending route updates on reboot and set the delay time to 100 seconds.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] bgp update-delay on-startup 100
bgp update-delay on-startup prefix-list
bgp update-delay on-startup prefix-list
Use bgp update-delay on-startup prefix-list to configure BGP to immediately send route updates for routes that match a prefix list.
Use undo bgp update-delay on-startup prefix-list to restore the default.
bgp update-delay on-startup prefix-list ipv4-prefix-list-name
undo bgp update-delay on-startup prefix-list
No prefix list is specified to filter routes.
network-admin
ipv4-prefix-list-name: Specifies an IPv4 prefix list by its name, a case-sensitive string of 1 to 63 characters.
After the bgp update-delay on-startup command is configured, BGP delays sending updates for all routes on reboot. For BGP to immediately send updates for the specified routes, execute the bgp update-delay on-startup prefix-list command.
This command is available only to IPv4 prefix lists.
# In BGP instance view, configure BGP to send updates 100 seconds after reboot and immediately send updates for routes that match prefix list aaa.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] bgp update-delay on-startup 100
[Sysname-bgp-default] bgp update-delay on-startup prefix-list aaa
bgp update-delay on-startup
compare-different-as-med
Use compare-different-as-med to enable MED comparison for routes from peers in different ASs.
Use undo compare-different-as-med to restore the default.
compare-different-as-med
undo compare-different-as-med
MED comparison is disabled for routes from peers in different ASs.
BGP-VPN instance view
network-admin
If multiple routes to a destination exist, the route with the smallest MED is selected.
Generally BGP only compares MEDs of routes received from the same AS. You can use the compare-different-as-med command to force BGP to compare MED values of routes received from different ASs.
Do not use this command unless relevant ASs adopt the same IGP protocol and routing selection method.
# In BGP instance view, enable MED comparison for routes from peers in different ASs.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] compare-different-as-med
confederation id
Use confederation id to configure a confederation ID.
Use undo confederation id to restore the default.
confederation id as-number
undo confederation id
No confederation ID is configured.
network-admin
as-number: Specifies an AS number that identifies the confederation, in the range of 1 to 4294967295.
You can split an AS into several sub-ASs, and each sub-AS remains fully meshed. These sub-ASs form a confederation. Key path attributes of a route, such as the Next_HOP, MED, and LOCAL_PREF, are not discarded when crossing each sub-AS. The sub-ASs still look like one AS from the perspective of other ASs. The AS number is the confederation ID.
Confederation can ensure the integrity of the former AS, and solve the problem of too many IBGP connections in the AS.
Configure the same confederation ID for all routers in one confederation.
For a non-confederation BGP router that establishes a BGP connection to a router in a confederation, the confederation ID is the AS number of the router.
# Confederation 9 consists of four sub-ASs numbered 38, 39, 40 and 41. Peer 10.1.1.1 is a member of sub-AS 38. Peer 200.1.1.1 is a member outside of confederation 9, which belongs to AS 98. Confederation 9 looks like one AS (with AS number 9) from the perspective of peer 200.1.1.1. This example uses a router in sub-AS 41.
<Sysname> system-view
[Sysname] bgp 41
[Sysname-bgp-default] confederation id 9
[Sysname-bgp-default] confederation peer-as 38 39 40
[Sysname-bgp-default] group Confed38 external
[Sysname-bgp-default] peer Confed38 as-number 38
[Sysname-bgp-default] peer 10.1.1.1 group Confed38
[Sysname-bgp-default] group Remote98 external
[Sysname-bgp-default] peer Remote98 as-number 98
[Sysname-bgp-default] peer 200.1.1.1 group Remote98
confederation nonstandard
confederation nonstandard
Use confederation nonstandard to enable compatibility with routers not compliant with RFC 3065 in the confederation.
Use undo confederation nonstandard to restore the default.
confederation nonstandard
undo confederation nonstandard
The device is compatible with only routers compliant with RFC 3065 in the confederation.
network-admin
Configure this command on all routers compliant with RFC 3065 to interact with those routers not compliant with RFC 3065 in the confederation.
# Confederation 100 consists of two sub-ASs, 64000 and 65000, and contains routers not compliant with RFC 3065. Enable compatibility with routers not compliant with RFC 3065 in the confederation.
<Sysname> system-view
[Sysname] bgp 64000
[Sysname-bgp-default] confederation id 100
[Sysname-bgp-default] confederation peer-as 65000
[Sysname-bgp-default] confederation nonstandard
confederation id
confederation peer-as
confederation peer-as
Use confederation peer-as to specify confederation peer sub-ASs.
Use undo confederation peer-as to remove the specified confederation peer sub-ASs.
confederation peer-as as-number-list
undo confederation peer-as [ as-number-list ]
No confederation peer sub-ASs are specified.
network-admin
as-number-list: Specifies a sub-AS number list. A maximum of 32 sub-ASs can be configured in one command line. The expression is as-number-list = as-number &<1-32>. The as-number argument specifies a sub-AS number in the range of 1 to 4294967295, and &<1-32> indicates that a maximum of 32 numbers can be specified.
Before this configuration, use the confederation id command to specify the confederation ID for the sub-ASs.
If the undo confederation peer-as command is executed without the as-number-list argument, all confederation peer sub-ASs are removed.
# In BGP instance view, specify confederation peer sub-ASs 2000 and 2001.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] confederation id 10
[Sysname-bgp-default] confederation peer-as 2000 2001
confederation id
confederation nonstandard
dampening
Use dampening to enable BGP route dampening.
Use undo dampening to restore the default.
dampening [ half-life-reachable half-life-unreachable reuse suppress ceiling | route-policy route-policy-name ] *
undo dampening
Route dampening is disabled.
BGP IPv4 unicast address family view
BGP-VPN IPv4 unicast address family view
BGP IPv6 unicast address family view
BGP-VPN IPv6 unicast address family view
BGP IPv4 multicast address family view
BGP IPv6 multicast address family view
network-admin
half-life-reachable: Specifies a half-life for active routes, in the range of 1 to 45 minutes. By default, the value is 15 minutes.
half-life-unreachable: Specifies a half-life for suppressed routes, in the range of 1 to 45 minutes. By default, the value is 15 minutes.
reuse: Specifies a reuse threshold value for suppressed routes, in the range of 1 to 20000. A suppressed route whose penalty value decreases under the value is reused. By default, the reuse value is 750. The reuse threshold must be less than the suppression threshold.
suppress: Specifies a suppression threshold in the range of 1 to 20000. The route with a penalty value greater than the threshold is suppressed. The default value is 2000.
ceiling: Specifies a ceiling penalty value in the range of 1001 to 20000. The value must be greater than the suppress value. By default, the value is 16000.
route-policy route-policy-name: Specifies a routing policy by its name, a case-sensitive string of 1 to 63 characters.
This command dampens only EBGP routes.
If an EBGP peer goes down after you configure this command, routes coming from the peer are dampened but not deleted.
# In BGP IPv4 unicast address family view, configure BGP route dampening. Set the half-life for both active and suppressed routes to 10 minutes, the reuse threshold to 1000, the suppression threshold to 2000, and the ceiling penalty to 10000.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] dampening 10 10 1000 2000 10000
display bgp dampening parameter
default local-preference
Use default local-preference to configure a default local preference.
Use undo default local-preference to restore the default.
default local-preference value
undo default local-preference
The default local preference is 100.
BGP IPv4 unicast address family view
BGP-VPN IPv4 unicast address family view
BGP IPv6 unicast address family view
BGP-VPN IPv6 unicast address family view
BGP IPv4 multicast address family view
BGP IPv6 multicast address family view
network-admin
value: Specifies a default local preference in the range of 0 to 4294967295. A larger value represents a higher preference.
You can also use the apply local-preference command in a routing policy to configure the local preference for BGP routes. If no routing policy is configured, all BGP routes use the local preference set by the default local-preference command. If a routing policy is configured, BGP routes matching the routing policy use the local preference set by the apply local-preference command. Other BGP routes use the local preference set by the default local-preference command.
# In BGP IPv4 unicast address family view, set the default local preference to 180.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] default local-preference 180
apply local-preference
route-policy
default med
Use default med to specify a default MED value.
Use undo default med to restore the default.
default med med-value
undo default med
The default MED value is 0.
BGP IPv4 unicast address family view
BGP-VPN IPv4 unicast address family view
BGP IPv6 unicast address family view
BGP-VPN IPv6 unicast address family view
BGP IPv4 multicast address family view
BGP IPv6 multicast address family view
network-admin
med-value: Specifies the default MED value in the range of 0 to 4294967295.
BGP selects a MED value in the following order:
1. MED set by the apply cost command.
2. MED set by the med keyword in the import-route command.
3. MED set by the default med command.
4. Original MED of a BGP route, or MED changed from the metric of a redistributed IGP route.
# In BGP IPv4 unicast address family view, set the default MED to 25.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] default med 25
apply cost
import-route
route-policy
default-route imported
Use default-route imported to enable default route redistribution into the BGP routing table.
Use undo default-route imported to restore the default.
default-route imported
undo default-route imported
Default route redistribution into the BGP routing table is disabled.
BGP IPv4 unicast address family view
BGP-VPN IPv4 unicast address family view
BGP IPv6 unicast address family view
BGP-VPN IPv6 unicast address family view
BGP IPv4 multicast address family view
BGP IPv6 multicast address family view
network-admin
By default, BGP does not redistribute default IGP routes. To redistribute default IGP routes into the BGP routing table, you must use the default-route imported command together with the import-route command.
# In BGP IPv4 unicast address family view, enable default route redistribution from OSPF process 1 into the BGP routing table.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] default-route imported
[Sysname-bgp-default-ipv4] import-route ospf 1
import-route
display bgp dampening parameter
Use display bgp dampening parameter to display BGP route dampening parameters.
display bgp [ instance instance-name ] dampening parameter { ipv4 | ipv6 } [ multicast | [ unicast ] [ vpn-instance vpn-instance-name ] ]
display bgp [ instance instance-name ] dampening parameter vpnv4
network-admin
network-operator
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 route dampening parameters for the default BGP instance.
ipv4: Displays BGP IPv4 route dampening parameters.
ipv6: Displays BGP IPv6 route dampening parameters.
multicast: Displays BGP multicast route dampening parameters.
unicast: Displays BGP unicast route dampening parameters.
vpnv4: Displays IBGP VPNv4 route dampening parameters.
vpn-instance vpn-instance-name: Specifies an MPLS L3VPN instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command displays BGP route dampening parameters for the public network.
By default, the unicast keyword is used if neither the multicast keyword nor the unicast keyword is specified.
# Display BGP IPv4 unicast route dampening parameters.
<Sysname> display bgp dampening parameter ipv4
Maximum suppression time (in seconds) : 3973
Ceiling value : 16000
Reuse value : 750
Half-life time for reachable routes (in seconds) : 900
Half-life time for unreachable routes (in seconds) : 900
Suppression threshold : 2000
Table 2 Command output
Field |
Description |
Maximum suppression time |
Maximum time (in seconds) for the penalty value to decrease from the ceiling value to the reuse value. |
Ceiling value |
Penalty ceiling value. |
Reuse value |
Reuse threshold. |
dampening
display bgp group
Use display bgp group to display BGP peer group information.
display bgp [ instance instance-name ] group ipv4 [ mdt | multicast | mvpn | rtfilter | [ unicast ] [ vpn-instance vpn-instance-name ] ] [ group-name group-name ]
display bgp [ instance instance-name ] group ipv6 [ multicast | [ unicast ] [ vpn-instance vpn-instance-name ] ] [ group-name group-name ]
display bgp [ instance instance-name ] group link-state [ group-name group-name ]
display bgp [ instance instance-name ] group vpnv4 [ vpn-instance vpn-instance-name ] [ group-name group-name ]
display bgp [ instance instance-name ] group vpnv6 [ group-name group-name ]
network-admin
network-operator
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 peer group information for the default BGP instance.
ipv4: Displays IPv4 BGP peer group information.
ipv6: Displays IPv6 BGP peer group information.
link-state: Displays BGP LS peer group information.
mdt: Displays BGP MDT peer group information.
multicast: Displays BGP multicast peer group information.
mvpn: Displays BGP MVPN peer group information.
rtfilter: Displays BGP IPv4 RT filter peer group information.
unicast: Displays BGP unicast peer group information.
vpnv4: Displays BGP VPNv4 peer group information.
vpnv6: Displays BGP VPNv6 peer group information.
vpn-instance vpn-instance-name: Specifies an MPLS L3VPN instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command displays BGP peer group information for the public network.
group-name group-name: Specifies a BGP peer group by its name, a case-sensitive string of 1 to 47 characters. If you do not specify a group, this command displays brief information about all BGP peer groups for the specified address family.
By default, the unicast keyword is used if the unicast, mdt, mvpn, rtfilter, and multicast keywords are not specified.
# Display brief information about all BGP IPv4 unicast peer groups.
<Sysname> display bgp group ipv4
BGP peer group: group1
Remote AS: 600
Type: external
Members:
1.1.1.10
Remote AS number: not specified
Type: external
Members:
# Display detailed information about BGP IPv4 unicast peer group group1.
<Sysname> display bgp group ipv4 group-name group1
BGP peer group: group1
Remote AS: 600
Type: external
Maximum number of prefixes allowed: 4294967295
Threshold: 75%
Configured hold time: 180 seconds
Keepalive time: 60 seconds
Minimum time between advertisements: 30 seconds
Peer preferred value: 0
Site-of-Origin: Not specified
Routing policy configured:
No routing policy is configured
Members:
Peer AS MsgRcvd MsgSent OutQ PrefRcv Up/Down State
1.1.1.10 600 0 0 0 0 00:00:55 Established
# Display detailed information about BGP IPv6 unicast peer group group2.
<Sysname> display bgp group ipv6 group-name group2
BGP peer group: group2
Remote AS: 600
Type: external
Maximum number of prefixes allowed: 4294967295
Threshold: 75%
Configured hold time: 180 seconds
Keepalive time: 60 seconds
Minimum time between advertisements: 30 seconds
Peer preferred value: 0
IPsec profile name: profile001
Site-of-Origin: Not specified
Routing policy configured:
No routing policy is configured
Members:
Peer AS MsgRcvd MsgSent OutQ PrefRcv Up/Down State
2::2 600 0 0 0 0 00:00:45 Established
3::3 600 0 0 0 0 00:00:40 Established
Table 3 Command output
Field |
Description |
BGP peer group |
Name of the BGP peer group. |
Remote AS |
AS number of the peer group. |
Type |
Type of the peer groups: · external—EBGP peer group. · internal—IBGP peer group. |
Maximum number of prefixes allowed |
Maximum number of routes allowed to learn from the peer. |
Threshold |
Percentage of received routes from the peer to maximum routes allowed to learn from the peer. If the percentage is reached, the system generates a log message. |
Configured hold time |
Configured hold interval in seconds. |
Keepalive time |
Keepalive interval in seconds. |
Minimum time between advertisements |
Minimum route advertisement interval in seconds. |
Peer preferred value |
Preferred value specified for routes from the peer. |
Site-of-Origin |
SoO for the peer group. |
Routing policy configured |
Routing policy configured for the peer group. If you do not specify a routing policy, this field displays No routing policy is configured. |
Members |
Information about peers included in the peer group. |
* - Dynamically created peer |
An asterisk (*) before a peer address indicates that the peer is a dynamic peer. |
Peer |
IPv4 or IPv6 address of the peer. |
AS |
AS number of the peer. |
MsgRcvd |
Number of messages received. |
MsgSent |
Number of messages sent. |
OutQ |
Number of messages to be sent. |
PrefRcv |
For the IPv4, IPv6, VPNv4, and VPNv6 address families, this field displays the number of prefixes received from the peer. For the IPv4 MDT address family, this field displays the number of MDT messages received from the peer. |
Up/Down |
Lasting time of the current BGP session state. |
State |
Current state of the BGP session between the local router and the peer. |
display bgp instance-info
Use display bgp instance-info to display information about all BGP instances.
display bgp instance-info
network-admin
network-operator
# Display information about all BGP instances.
<Sysname> display bgp instance-info
Total BGP instances: 3
BGP instance name AS
BGP1 100
BGP2 200
BGP3 300
Table 4 Command output
Field |
Description |
Total BGP instances |
Number of BGP instances. |
BGP instance name |
BGP instance name. |
AS |
AS number of the BGP instance. |
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 ] | 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.
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
Origin: i - IGP, e - EGP, ? - incomplete
Prefix codes: E link, V node, T IP reachable 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, D direct, S static,
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
* >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 : [T][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 5 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. |
Prefix codes |
Route status codes: · E – link. · V – node. · T – IP reachable route. · u/U – unknown. · I – Identifier. · N – local node. · R – remote node. · L – link. · P – prefix. · O – OSPF. · D – direct. · S – static. · 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. |
Origin |
Origin of the route: · i – IGP—Originated in the AS. The origin of routes advertised with the network command is IGP. · e – EGP—Learned through EGP. · ? – incomplete—Unknown origin. The origin of routes redistributed from IGP protocols is INCOMPLETE. |
Network |
NLRI for the LS. |
NextHop |
Next hop IP address. |
LocPrf |
Local preference. |
OutLabel |
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. |
# 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
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
Table 6 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 ABR bit. ¡ 30[E]—OSPF External bit. · Metric—Link or prefix cost. |
AS-path |
AS_PATH attribute of the route, which records the ASs the route has passed and avoids routing loops. |
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 7 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 |
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 network
Use display bgp network to display information about routes advertised by the network command and shortcut routes configured by the network short-cut command.
display bgp [ instance instance-name ] network { ipv4 | ipv6 } [ multicast | [ unicast ] [ vpn-instance vpn-instance-name ] ]
network-admin
network-operator
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 information for the default BGP instance.
ipv4: Displays IPv4 address family information.
ipv6: Displays IPv6 address family information.
multicast: Displays BGP multicast address family information.
unicast: Displays BGP unicast address family information.
vpn-instance vpn-instance-name: Specifies an MPLS L3VPN instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command displays routing information for the public network.
By default, the unicast keyword is used if neither the multicast keyword nor the unicast keyword is specified.
# Display information about routes advertised by the network command and shortcut routes configured by the network short-cut command in the IPv4 unicast address family.
<Sysname> display bgp network ipv4
BGP local router ID: 192.168.1.135
Local AS number: 100
Network Mask Route-policy Short-cut
20.1.1.0 255.255.255.0 No
40.1.1.0 255.255.255.0 abc No
30.1.1.0 255.255.255.0 Yes
# Display information about routes advertised by the network command and shortcut routes configured by the network short-cut command in the IPv6 unicast address family.
<Sysname> display bgp network ipv6
BGP local router ID: 192.168.1.135
Local AS number: 100
Network PrefixLen Route-policy Short-cut
1:: 24 No
2:: 24 No
3:: 64 policy1 No
2:: 24 Yes
Table 8 Command output
Field |
Description |
Network |
Destination network address of the routes advertised by the network command and the shortcut routes. |
Mask |
Mask of the destination network address. |
PrefixLen |
Prefix length of the destination network address. |
Route-policy |
Routing policy that is applied to the route. |
Short-cut |
Whether the route is a shortcut route: · Yes. · No. |
display bgp non-stop-routing status
Use display bgp non-stop-routing status to display BGP NSR status information.
display bgp [ instance instance-name ] non-stop-routing status
The following compatibility matrix shows the support of hardware platforms for this command:
Hardware |
Command compatibility |
CSAP-NTA-100, CSAP-NTA-200, CSAP-NTA-AK375 |
Yes |
CSAP-NTA-300, CSAP-NTA-400, CSAP-NTA-500, CSAP-NTA-600 |
Yes |
CSAP-NTA-V200, CSAP-NTA-V1000 |
No |
network-admin
network-operator
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 NSR status information for the default BGP instance.
# Display BGP NSR status information.
<Sysname> display bgp non-stop-routing status
Location of preferred standby process: -
TCP NSR status: Not ready
Table 9 Command output
Field |
Description |
BGP NSR status |
BGP NSR status: · Ready—BGP NSR has backed up BGP neighbor and routing information from the active process to the standby process. In this state, BGP NSR can ensure continuous routing when an active/standby process switchover occurs. · Not ready—BGP NSR is backing up BGP neighbor and routing information from the active process to the standby process. If an active/standby process switchover occurs in this state, traffic is interrupted and the BGP session will be re-established. · Not configured—BGP NSR is disabled. |
Location of preferred standby process |
(CSAP-NTA-100[200][300][400][500][600][AK375])ID of the IRF member device where the preferred standby process resides. This field displays - if no standby processes exist. |
TCP NSR status |
TCP NSR status: · Ready—TCP NSR has backed up TCP connection information from the active process to the standby process. · Not ready—TCP NSR is backing up TCP connection information from the active process to the standby process. |
display bgp paths
Use display bgp paths to display BGP path attribute information.
display bgp [ instance instance-name ] paths [ as-regular-expression ]
network-admin
network-operator
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 path attribute information for the default BGP instance.
as-regular-expression: Displays information about BGP path attributes whose AS_PATH attribute matches the specified regular expression. The as-regular-expression argument is a string of 1 to 256 characters. If you do not specify this argument, the command displays information about all BGP path attributes.
# Display information about all BGP path attributes.
<Sysname> display bgp paths
RefCount MED Path/Origin
3 0 ?
2 0 100i
3 0 100i
1 0 ?
1 0 ?
1 0 ?
Table 10 Command output
Field |
Description |
RefCount |
Number of BGP routes with these path attributes. |
MED |
MULTI_EXIT_DISC attribute. |
Path/Origin |
AS_PATH and ORIGIN attributes of the route: · AS_PATH attribute—Records the ASs the route has passed, which avoids routing loops. · ORIGIN attribute—Identifies the origin of the route: ¡ i—Originated in the AS. The origin of routes advertised with the network command is IGP. ¡ e—Learned through EGP. ¡ ?—Unknown origin. The origin of routes redistributed from IGP protocols is INCOMPLETE. |
display bgp peer
Use display bgp peer to display BGP peer or peer group information.
display bgp [ instance instance-name ] peer ipv4 [ mdt | multicast | mvpn | rtfilter | [ unicast ] [ vpn-instance vpn-instance-name ] ] [ ipv4-address mask-length | { ipv4-address | group-name group-name } log-info | [ ipv4-address ] verbose ]
display bgp [ instance instance-name ] peer ipv6 [ multicast | [ unicast ] [ vpn-instance vpn-instance-name ] ] [ ipv6-address prefix-length | { ipv6-address | group-name group-name } log-info | [ ipv6-address ] verbose ]
display bgp [ instance instance-name ] peer ipv6 [ unicast ] [ ipv4-address mask-length | ipv4-address log-info | [ ipv4-address ] verbose ]
display bgp [ instance instance-name ] peer link-state [ ipv4-address mask-length | ipv6-address prefix-length | { ipv4-address | ipv6-address | group-name group-name } log-info | [ ipv4-address | ipv6-address ] verbose ]
display bgp [ instance instance-name ] peer vpnv4 [ vpn-instance vpn-instance-name ] [ ipv4-address mask-length | { ipv4-address | group-name group-name } log-info | [ ipv4-address ] verbose ]
display bgp [ instance instance-name ] peer vpnv6 [ ipv4-address mask-length | { ipv4-address | group-name group-name } log-info | [ ipv4-address ] verbose ]
network-admin
network-operator
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 peer or peer group information for the default BGP instance.
ipv4: Displays IPv4 BGP peer or peer group information.
ipv6: Displays IPv6 BGP peer or peer group information.
link-state: Displays BGP LS peer or peer group information.
vpnv4: Displays BGP VPNv4 peer or peer group information.
vpnv6: Displays BGP VPNv6 peer or peer group information.
mdt: Displays BGP MDT peer or peer group information.
multicast: Displays BGP multicast peer or peer group information.
mvpn: Displays BGP MVPN peer or peer group information.
rtfilter: Displays BGP IPv4 RT filter peer or peer group information.
unicast: Displays BGP unicast peer or peer group information.
vpn-instance vpn-instance-name: Specifies an MPLS L3VPN instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command displays BGP peer or peer group information for the public network.
ipv4-address mask-length: Specifies a subnet. The value range for the mask length is 0 to 32. If you specify a subnet, this command displays information about all dynamic peers in the subnet.
ipv4-address: Specifies a peer by its IPv4 address.
ipv6-address prefix-length: Specifies a subnet. The value range for the prefix length is 0 to 128. If you specify a subnet, this command displays information about all dynamic peers in the subnet.
ipv6-address: Specifies a peer by its IPv6 address.
group-name group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters.
log-info: Displays log information.
verbose: Displays detailed information. If you do not specify this keyword, the command displays brief BGP peer or peer group information.
If you do not specify any parameters, this command displays brief information about all BGP peers for the specified address family.
By default, the unicast keyword is used if the unicast, mdt, mvpn, rtfilter, and multicast keywords are not specified.
# Display brief information about all BGP IPv4 unicast peers.
<Sysname> display bgp peer ipv4
BGP local router ID: 192.168.100.1
Local AS number: 100
Total number of peers: 1 Peers in established state: 1
* - Dynamically created peer
Peer AS MsgRcvd MsgSent OutQ PrefRcv Up/Down State
10.2.1.2 200 13 16 0 0 00:10:34 Established
Table 11 Command output
Field |
Description |
* - Dynamically created peer |
An asterisk (*) before a peer address indicates that the peer is a dynamic peer. |
Peer |
IPv4 or IPv6 address of the peer. |
AS |
AS number of the peer. |
MsgRcvd |
Number of messages received. |
MsgSent |
Number of messages sent. |
OutQ |
Number of messages to be sent. |
PrefRcv |
For the IPv4, IPv6, VPNv4, and VPNv6 address families, this field displays the number of prefixes that have been received from the peer and added into the local BGP routing table. For the IPv4 MDT address family, this field displays the number of MDT messages received from the peer. For IPv4 RT filter address family, this field displays the number of route targets received from the peer. |
Up/Down |
Lasting time of the current BGP session state. |
State |
Current state of the BGP session between the local router and the peer. |
# Display brief information about all dynamic peers in network 1.1.1.0/24.
<Sysname> display bgp peer ipv4 1.1.1.0 24
Dynamic address range: 1.1.1.0 24
Configured: Active Hold Time: 3 sec Keepalive Time: 1 sec
Address family IPv4 Unicast: Configured
Address family IPv4 Multicast: Configured
Address family IPv4 Label: Configured
Address family VPNv4: Configured
Address family IPv4 RT-Filter: Configured
Address family IPv6 Unicast: Configured
Address family VPNv6: Configured
Maximum allowed prefix number: 100
Threshold: 75%
Minimum time between advertisements is 100 seconds
Optional capabilities:
Multi-protocol extended capability has been enabled
Route refresh capability has been enabled
Nexthop self has been configured
Keep-all-routes has been configured
Send community has been configured
Send extend community has been configured
Default route originating has been configured
Multi-hop ebgp has been enabled
Peer preferred value: 100
BFD: Enabled
Site-of-Origin: 1:1
Routing policy configured:
No import as-path-acl list
Export as-path-acl list is: 22
No import prefix list
Export prefix list is: p1
No import route policy
Export route policy is: p1
No import filter-policy
No export filter-policy
Dynamic peers:
# Display brief information about all dynamic peers in network 1::/64.
<Sysname> display bgp peer ipv6 1:: 64
Dynamic address range: 1:: 64
Configured: Active Hold Time: 180 sec Keepalive Time: 60 sec
Address family IPv6 Unicast: Configured
Maximum allowed prefix number: 4294967295
Threshold: 75%
Minimum time between advertisements is 15 seconds
Optional capabilities:
Multi-protocol extended capability has been enabled
Route refresh capability has been enabled
Send community has been configured
Peer preferred value: 0
Site-of-Origin: Not specified
Routing policy configured:
No routing policy is configured
Dynamic peers:
1::1
Table 12 Command output
Field |
Description |
Type |
BGP connection type between the local router and the dynamic peer: · IBGP link—IBGP connection. · EBGP link—EBGP connection. |
Configured |
Timers configured on the local router in seconds, including the hold time (Active Hold Time) and keepalive interval (Keepalive Time). |
Address family IPv4 Unicast |
IPv4 unicast address family capability. |
Address family link-state |
LS address family capability. |
Address family IPv6 Unicast |
IPv6 unicast address family capability. |
Address family IPv4 Multicast |
IPv4 multicast address family capability. |
Address family IPv6 Multicast |
IPv6 multicast address family capability. |
Address family MDT |
IPv4 MDT address family capability. |
Address family IPv4 RT-Filter |
IPv4 RT filter address family capability. |
Maximum allowed prefix number |
Maximum number of routes allowed to learn from the peer. |
Threshold |
Percentage of received routes from the peer to maximum routes allowed to learn from the peer. If the percentage is reached, the system generates alarm messages. |
Minimum time between advertisements |
Minimum route advertisement interval in seconds. |
Optional capabilities |
Optional capabilities supported by the local end. |
Peer Preferred Value |
Preferred value specified for the routes from the peer. |
BFD |
Whether BFD is enabled to detect the link to the BGP peers. |
Routing policy configured |
Routing policy configured for the peer. If you do not specify a routing policy, this field displays No routing policy is configured. |
Dynamic peers |
IP addresses of dynamic peers. |
# Display detailed information about BGP IPv4 unicast peer 10.2.1.2.
<Sysname> display bgp peer ipv4 10.2.1.2 verbose
Peer: 10.2.1.2 Local: 192.168.100.1
BGP version 4, remote router ID 192.168.100.2
BGP current state: Established, Up for 00h11m10s
BGP current event: RecvKeepalive
BGP last state: OpenConfirm
Port: Local - 179 Remote - 60672
Configured: Active Hold Time: 180 sec Keepalive Time: 60 sec
Received : Active Hold Time: 180 sec
Negotiated: Active Hold Time: 180 sec Keepalive Time: 60 sec
Peer optional capabilities:
Peer supports BGP multi-protocol extension
Peer supports BGP route refresh capability
Peer supports BGP route AS4 capability
Address family IPv4 Unicast: advertised and received
InQ updates: 0, OutQ updates: 0
NLRI statistics:
Rcvd: UnReach NLRI 0, Reach NLRI 0
Sent: UnReach NLRI 0, Reach NLRI 0
Message statistics:
Msg type Last rcvd time/ Current rcvd count/ History rcvd count/
Last sent time Current sent count History sent count
Open 10:38:50-2013.7.23 1 1
10:38:50-2013.7.23 1 1
Update 10:38:51-2013.7.23 1 1
10:38:51-2013.7.23 1 1
Notification - 0 0
- 0 0
Keepalive 10:38:50-2013.7.23 1 1
10:38:50-2013.7.23 1 1
RouteRefresh - 0 0
- 0 0
Total - 3 3
- 3 3
Maximum allowed prefix number: 4294967295
Threshold: 75%
Minimum time between advertisements is 30 seconds
Optional capabilities:
Multi-protocol extended capability has been enabled
Route refresh capability has been enabled
GTSM has been enabled, and the maximum number of hops is 10
BFD: Enabled
Site-of-Origin: Not specified
Routing policy configured:
No routing policy is configured
# Display detailed information about BGP IPv6 unicast peer 1::2.
<Sysname> display bgp peer ipv6 1::2 verbose
Peer: 1::2 Local: 192.168.1.136
Type: EBGP link
BGP version 4, remote router ID 192.168.1.135
BGP current state: Established, Up for 00h05m48s
BGP current event: RecvKeepalive
BGP last state: OpenConfirm
Port: Local - 13184 Remote - 179
Configured: Active Hold Time: 180 sec Keepalive Time: 60 sec
Received : Active Hold Time: 180 sec
Negotiated: Active Hold Time: 180 sec Keepalive Time: 60 sec
Peer optional capabilities:
Peer supports BGP multi-protocol extension
Peer supports BGP route refresh capability
Peer supports BGP route AS4 capability
Address family IPv6 Unicast: advertised and received
InQ updates: 0, OutQ updates: 0
NLRI statistics:
Rcvd: UnReach NLRI 0, Reach NLRI 0
Sent: UnReach NLRI 0, Reach NLRI 3
Message statistics:
Msg type Last rcvd time/ Current rcvd count/ History rcvd count/
Last sent time Current sent count History sent count
Open 18:59:15-2013.4.24 1 1
18:59:15-2013.4.24 1 2
Update - 0 0
18:59:16-2013.4.24 1 1
Notification - 0 0
18:59:15-2013.4.24 0 1
Keepalive 18:59:15-2013.4.24 1 1
18:59:15-2013.4.24 1 1
RouteRefresh - 0 0
- 0 0
Total - 2 2
- 3 5
Maximum allowed prefix number: 4294967295
Threshold: 75%
Minimum time between advertisements is 30 seconds
Optional capabilities:
Multi-protocol extended capability has been enabled
Route refresh capability has been enabled
GTSM has been enabled, and the maximum number of hops is 10
BFD: Enabled
IPsec profile name: profile001
Site-of-Origin: Not specified
Routing policy configured:
No routing policy is configured
Table 13 Command output
Field |
Description |
|
Peer |
IPv4 or IPv6 address of the peer. |
|
Local |
Local router ID. |
|
Type |
BGP connection type between the local router and the peer: · IBGP link—IBGP connection. · EBGP link—EBGP connection. |
|
remote router ID |
Router ID of the peer. |
|
BGP current state |
Current state of the BGP session between the local router and the peer. |
|
Up for |
Lasting time of the BGP session. |
|
BGP current event |
Current event of the BGP session between the local router and the peer. |
|
BGP last state |
Previous state of the BGP session. |
|
Port |
TCP port numbers of the local router and its peer. |
|
Configured |
Timers configured on the local router in seconds, including the hold time (Active Hold Time) and keepalive interval (Keepalive Time). |
|
Received |
Received timer (configured on the peer) in seconds, including the hold time (Active Hold Time). |
|
Negotiated |
Negotiated timers in seconds, including the hold time (Active Hold Time) and keepalive interval (Keepalive Time). |
|
Peer optional capabilities |
Optional capabilities supported by the peer. |
|
Peer supports BGP route AS4 capability |
The peer supports 4-byte AS number. |
|
Address family IPv4 Unicast |
IPv4 unicast address family capability: routes of the address family can be advertised and received. |
|
Address family LS |
LS address family capability: routes of the address family can be advertised and received. |
|
Address family IPv6 Unicast |
IPv6 unicast address family capability: routes of the address family can be advertised and received. |
|
Address family IPv4 Multicast |
IPv4 multicast address family capability: routes of the address family can be advertised and received. |
|
Address family IPv6 Multicast |
IPv6 multicast address family capability: routes of the address family can be advertised and received. |
|
Address family MDT |
IPv4 MDT address family capability: routes of the address family can be advertised and received. |
|
Address family IPv4 RT-Filter |
IPv4 RT filter address family capability: route target filter information can be advertised and received. |
|
InQ updates |
Number of received updates to be processed. |
|
OutQ updates |
Number of updates to be sent to the peer. |
|
NLRI statistics |
Number of the reachable and unreachable routes received from and sent to the peer after the BGP session is established. |
|
Message statistics |
BGP message statistics. |
|
Msg type |
BGP message type. |
|
Last rcvd time/Last sent time |
Time when the most recent BGP message was received from or sent to the peer. |
|
Current rcvd count/Current sent count |
Number of BGP messages received from or sent to the peer on the current BGP session. |
|
History rcvd count/History sent count |
Number of BGP messages received from or sent to the peer since the BGP peer relationship was established. |
|
Total |
Total number of received and sent messages. |
|
Maximum allowed prefix number |
Maximum number of routes allowed to learn from the peer. |
|
Threshold |
Percentage of received routes from the peer to maximum routes allowed to learn from the peer. If the percentage is reached, the system generates alarm messages. |
|
Minimum time between advertisements |
Minimum route advertisement interval in seconds. |
|
Optional capabilities |
Optional capabilities supported by the local end. |
|
Peer Preferred Value |
Preferred value specified for the routes from the peer. |
|
GTSM has been enabled |
GTSM is supported. |
|
the maximum number of hops |
Maximum number of hops to the specified peer. |
|
BFD |
Whether BFD is enabled to detect the link to the BGP peer. |
|
Routing policy configured |
Routing policy configured for the peer. If you do not specify a routing policy, this field displays No routing policy is configured. |
|
# Display log information for BGP IPv4 unicast peer 1.1.1.1.
<Sysname> display bgp peer ipv4 1.1.1.1 log-info
Date Time State Notification
Error/SubError
06-Feb-2013 22:54:42 Down Send notification with error 6/4
<administrative reset>
Table 14 Command output
Field |
Description |
Peer |
IPv4 or IPv6 address of the peer. |
Date |
Date on which the Notification was sent or received. |
Time |
Time at which the Notification was sent or received. |
State |
BGP session state: · Up—The BGP session is in Established state. · Down—The BGP session is down. |
Notification Error/SubError |
Error code of the Notification, indicating the cause of why the BGP session was down. · Error—Refers to the error code, which identifies the type of the Notification. · SubError—Refers to the error subcode of the Notification, which identifies the specific information about the reported error. |
display bgp routing-table dampened
Use display bgp routing-table dampened to display dampened BGP routes.
display bgp [ instance instance-name ] routing-table dampened { ipv4 | ipv6 } [ multicast | [ unicast ] [ vpn-instance vpn-instance-name ] ]
display bgp [ instance instance-name ] routing-table dampened vpnv4
network-admin
network-operator
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 dampened BGP routes for the default BGP instance.
ipv4: Displays dampened BGP IPv4 routes.
ipv6: Displays dampened BGP IPv6 routes.
vpnv4: Displays dampened IBGP VPNv4 routes.
multicast: Displays dampened BGP multicast routes.
unicast: Displays dampened BGP unicast routes.
vpn-instance vpn-instance-name: Specifies an MPLS L3VPN instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command displays dampened BGP routes for the public network.
By default, the unicast keyword is used if neither the multicast keyword nor the unicast keyword is specified.
# Display dampened BGP IPv4 unicast routes.
<Sysname> display bgp routing-table dampened ipv4
BGP local router ID is 192.168.1.135
Status codes: * - valid, > - best, d - dampened, h - history
s - suppressed, S - stale, i - internal, e - external
Origin: i - IGP, e - EGP, ? - incomplete
Network From Reuse Path/Ogn
de 20.1.1.0/24 10.1.1.2 00:56:27 100i
# Display dampened BGP IPv6 unicast routes.
<Sysname> display bgp routing-table dampened ipv6
BGP local router ID is 192.168.1.135
Status codes: * - valid, > - best, d - dampened, h - history
s - suppressed, S - stale, i - internal, e - external
Origin: i - IGP, e - EGP, ? - incomplete
de Network : 2:: PrefixLen : 64
From : 10.1.1.1 Reuse : 00:39:49
Path/Ogn: 100i
de Network : 2:: PrefixLen : 64
Path/Ogn: 100i
Table 15 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. |
Origin |
Origin of the route: · i – IGP—Originated in the AS. The origin of routes advertised with the network command is IGP. · e – EGP—Learned through EGP. · ?– incomplete—Unknown origin. The origin of routes redistributed from IGP protocols is INCOMPLETE. |
Network |
Destination network address. |
From |
IP address from which the route was received. |
Reuse |
Reuse time of the route. |
Path/Ogn |
AS_PATH and ORIGIN attributes of the route: · AS_PATH attribute—Records the ASs the route has passed, which avoids routing loops. · ORIGIN attribute—Identifies the origin of the route. |
dampening
reset bgp dampening
display bgp routing-table flap-info
Use display bgp routing-table flap-info to display BGP route flap statistics.
display bgp [ instance instance-name ] routing-table flap-info ipv4 [ multicast | [ unicast ] [ vpn-instance vpn-instance-name ] ] [ ipv4-address [ { mask-length | mask } [ longest-match ] ] | as-path-acl as-path-acl-number ]
display bgp [ instance instance-name ] routing-table flap-info ipv6 [ multicast | [ unicast ] [ vpn-instance vpn-instance-name ] ] [ ipv6-address prefix-length | as-path-acl as-path-acl-number ]
display bgp [ instance instance-name ] routing-table flap-info vpnv4 [ ipv4-address [ { mask | mask-length } [ longest-match ] ] | as-path-acl as-path-acl-number ]
network-admin
network-operator
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 route flap statistics for the default BGP instance.
ipv4: Displays BGP IPv4 route flap statistics.
ipv6: Displays BGP IPv6 route flap statistics.
vpnv4: Displays IBGP VPNv4 route flap statistics.
multicast: Displays BGP multicast route flap statistics.
unicast: Displays BGP unicast route flap statistics.
vpn-instance vpn-instance-name: Specifies an MPLS L3VPN instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command displays BGP route flap statistics for the public network.
ipv4-address: Specifies a destination network address.
mask-length: Specifies a mask length in the range of 0 to 32.
mask: Specifies a network mask in dotted decimal notation.
longest-match: Specifies longest match mode, which selects the longest matching route through the following steps:
1. ANDs the specified network address with the mask of each route.
2. Matches a route if the AND result is the same as the network address of the route and the mask of the route is shorter than or equal to the specified mask.
3. Selects the route with the longest mask among the matching routes.
ipv6-address prefix-length: Displays route flap statistics for BGP IPv6 routes that match the specified network address, and match the prefix length in the range of 0 to 128.
as-path-acl as-path-acl-number: Displays route flap statistics for BGP routes that match the AS path list specified by its number in the range of 1 to 256.
If you specify only the ipv4-address argument, the system ANDs the network address with the mask of a route. If the result matches the network address of the route, the command displays flap statistics of the route.
If you specify the ipv4-address mask or ipv4-address mask-length argument, and do not specify the longest-match keyword, the command displays flap statistics of the BGP IPv4 unicast or multicast route that matches both the specified destination network address and the mask (or mask length).
By default, the unicast keyword is used if neither the multicast keyword nor the unicast keyword is specified.
# Display BGP IPv4 unicast route flap statistics.
<Sysname> display bgp routing-table flap-info ipv4
BGP local router ID is 192.168.1.135
Status codes: * - valid, > - best, d - dampened, h - history
s - suppressed, S - stale, i - internal, e - external
Origin: i - IGP, e - EGP, ? - incomplete
Network From Flaps Duration Reuse Path/Ogn
de 20.1.1.0/24 10.1.1.2 1 00:02:36 00:53:58 100i
# Display BGP IPv6 unicast route flap statistics.
<Sysname> display bgp routing-table flap-info ipv6
BGP local router ID is 192.168.1.135
Status codes: * - valid, > - best, d - dampened, h - history
s - suppressed, S - stale, i - internal, e - external
Origin: i - IGP, e - EGP, ? - incomplete
de Network : 2:: PrefixLen : 64
Duration: 00:03:25 Reuse : 00:39:28
Path/Ogn: 100i
de Network : 2:: PrefixLen : 64
Duration: 00:03:25 Reuse : 00:39:28
Path/Ogn: 100i
Table 16 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. |
Origin |
Origin of the route: · i – IGP—Originated in the AS. The origin of routes advertised with the network command is IGP. · e – EGP—Learned through EGP. · ?– incomplete—Unknown origin. The origin of routes redistributed from IGP protocols is INCOMPLETE. |
Network |
Destination network address. |
From |
Source IP address of the route. |
Flaps |
Number of routing flaps. |
Duration |
Duration time of the flap route. |
Reuse |
Reuse time of the route. |
Path/Ogn |
AS_PATH and ORIGIN attributes of the route: · AS_PATH attribute—Records the ASs the route has passed, which avoids routing loops. · ORIGIN attribute—Identifies the origin of the route. |
dampening
reset bgp flap-info
display bgp routing-table ipv4 multicast
Use display bgp routing-table ipv4 multicast to display BGP IPv4 multicast routing information.
display bgp [ instance instance-name ] routing-table ipv4 multicast [ ipv4-address [ { mask-length | mask } [ longest-match ] ] | ipv4-address [ mask-length | mask ] advertise-info | as-path-acl as-path-acl-number | community-list { { basic-community-list-number | comm-list-name } [ whole-match ] | adv-community-list-number } | peer ipv4-address { advertised-routes | received-routes } [ ipv4-address [ mask-length | mask ] | statistics ] | statistics ]
network-admin
network-operator
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 IPv4 multicast routing information for the default BGP instance.
ipv4-address: Specifies a destination network address.
mask-length: Specifies a mask length in the range of 0 to 32.
mask: Specifies a network mask in dotted decimal notation.
longest-match: Specifies longest match mode, which selects the longest matching route through the following steps:
1. ANDs the specified network address with the mask of each route.
2. Matches a route if the AND result is the same as the network address of the route and the mask of the route is shorter than or equal to the specified mask.
3. Selects the route with the longest mask among the matching routes.
advertise-info: Displays advertisement information for BGP IPv4 multicast routes.
as-path-acl as-path-acl-number: Displays BGP IPv4 multicast routes that match the AS path list specified by its number in the range of 1 to 256.
community-list: Displays BGP IPv4 multicast routes that match a community list.
basic-community-list-number: Specifies a basic community list by its number in the range of 1 to 99.
comm-list-name: Specifies a community list by its name, a case-sensitive string of 1 to 63 characters.
whole-match: Displays BGP IPv4 multicast routes exactly matching the specified community list. If you do not specify this keyword, the command displays BGP IPv4 multicast routes whose COMMUNITY attributes include the specified community list.
adv-community-list-number: Specifies an advanced community list by its number in the range of 100 to 199.
peer ipv4-address: Displays BGP IPv4 multicast routing information advertised to or received from the specified peer.
advertised-routes: Displays BGP IPv4 multicast routing information advertised to the specified peer.
received-routes: Displays BGP IPv4 multicast routing information received from the specified peer.
statistics: Displays routing statistics.
If you do not specify any parameters, this command displays brief information about all BGP IPv4 multicast routes.
If you specify only the ipv4-address argument, the system ANDs the network address with the mask of a route. If the result matches the network address of the route, the command displays information about the route.
If you specify the ipv4-address mask or ipv4-address mask-length argument and do not specify the longest-match keyword, this command displays information about the BGP IPv4 multicast route that matches both the specified destination network address and the mask (or mask length).
# Display brief information about all BGP IPv4 multicast routes.
<Sysname> display bgp routing-table ipv4 multicast
BGP local router ID is 192.168.1.62
Status codes: * - valid, > - best, d - dampened, h - history
s - suppressed, S - stale, i - internal, e - external
Origin: i - IGP, e - EGP, ? - incomplete
Network NextHop MED LocPrf PrefVal Path/Ogn
* > 5.5.5.5/32 127.0.0.1 0 32768 ?
* > 192.168.1.0 192.168.1.62 0 32768 ?
* > 192.168.1.62/32 127.0.0.1 0 32768 ?
# Display information about BGP IPv4 multicast routes that match AS path list 20.
<Sysname> display bgp routing-table ipv4 multicast as-path-acl 20
BGP local router ID is 192.168.1.62
Status codes: * - valid, > - best, d - dampened, h - history
s - suppressed, S - stale, i - internal, e - external
Origin: i - IGP, e - EGP, ? - incomplete
Network NextHop MED LocPrf PrefVal Path/Ogn
* > 5.5.5.5/32 127.0.0.1 0 32768 ?
* > 192.168.1.0 192.168.1.62 0 32768 ?
* > 192.168.1.62/32 127.0.0.1 0 32768 ?
# Display information about BGP IPv4 multicast routes that match BGP community list 100.
<Sysname> display bgp routing-table ipv4 multicast community-list 100
BGP local router ID is 192.168.1.62
Status codes: * - valid, > - best, d - dampened, h - history
s - suppressed, S - stale, i - internal, e - external
Origin: i - IGP, e - EGP, ? - incomplete
Network NextHop MED LocPrf PrefVal Path/Ogn
* > 5.5.5.5/32 127.0.0.1 0 32768 ?
* > 192.168.1.0 192.168.1.62 0 32768 ?
* > 192.168.1.62/32 127.0.0.1 0 32768 ?
# Display information about all BGP IPv4 multicast routes advertised to peer 192.168.1.139.
<Sysname> display bgp routing-table ipv4 multicast peer 192.168.1.139 advertised-routes
BGP local router ID is 192.168.1.62
Status codes: * - valid, > - best, d - dampened, h - history
s - suppressed, S - stale, i - internal, e - external
Origin: i - IGP, e - EGP, ? - incomplete
Network NextHop MED LocPrf Path/Ogn
* > 5.5.5.5/32 127.0.0.1 0 100 ?
* > 192.168.1.0 192.168.1.62 0 100 ?
# Display information about all BGP IPv4 multicast routes received from peer 192.168.1.139.
<Sysname> display bgp routing-table ipv4 multicast peer 192.168.1.139 received-routes
BGP local router ID is 192.168.1.62
Status codes: * - valid, > - best, d - dampened, h - history
s - suppressed, S - stale, i - internal, e - external
Origin: i - IGP, e - EGP, ? - incomplete
Network NextHop MED LocPrf PrefVal Path/Ogn
* >i 8.8.8.8/32 192.168.1.139 0 100 0 ?
* i 192.168.1.0 192.168.1.139 0 100 0 ?
Table 17 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. |
Origin |
Origin of the route: · i – IGP—Originated in the AS. The origin of routes advertised with the network command is IGP. · e – EGP—Learned through EGP. · ?– incomplete—Unknown origin. The origin of routes redistributed from IGP protocols is INCOMPLETE. |
Network |
Destination network address. |
NextHop |
Next hop IP address. |
MED |
MULTI_EXIT_DISC attribute. |
LocPrf |
Local preference value. |
PrefVal |
Preferred value of the route. |
Path/Ogn |
AS_PATH and ORIGIN attributes of the route: · AS_PATH—Records the ASs the route has passed. · ORIGIN—Identifies the origin of the route. |
# Display detailed information about BGP IPv4 multicast routes destined to network 5.5.5.5/32.
<Sysname> display bgp routing-table ipv4 multicast 5.5.5.5 32
BGP local router ID: 192.168.1.139
Local AS number: 100
BGP routing table information of 5.5.5.5/32:
From : 192.168.1.62 (192.168.1.62)
Rely nexthop : 192.168.1.62
Original nexthop: 192.168.1.62
OutLabel : NULL
AS-path : (null)
Origin : incomplete
Attribute value : MED 0, localpref 100, pref-val 0
State : valid, internal, best
Originator : 176.1.1.2
Cluster list : 80
IP precedence : N/A
QoS local ID : N/A
Traffic index : N/A
VPN-Peer UserID : N/A
DSCP : N/A
EXP : N/A
Table 18 Command output
Field |
Description |
Paths |
Number of routes: · available—Number of valid routes. · best—Number of optimal routes. |
From |
IP address of BGP peer that advertised the route. |
Rely Nexthop |
Next hop found by route recursion. If no next hop is found, this field displays not resolved. |
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. |
OutLabel |
Outgoing label of the route. |
AS-path |
AS_PATH attribute of the route. |
Origin |
Origin of the route: · igp—Originated in the AS. The origin of routes advertised with the network command is IGP. · egp—Learned through EGP. · incomplete—Unknown origin. The origin of routes redistributed from IGP protocols is INCOMPLETE. |
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. |
Originator |
Router ID of the peer that advertised the route to the reflector. |
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. |
VPN-Peer UserID |
VPN peer ID in the range of 1 to 134217727. N/A indicates that the route does not support this field. |
DSCP |
DSCP value in the range of 0 to 63. N/A indicates that the route does not support this field. |
EXP |
MPLS EXP value of the route. N/A indicates that the route does not support this field. |
# Display statistics for BGP IPv4 multicast routes advertised to peer 192.168.1.62.
<Sysname> display bgp routing-table ipv4 multicast peer 192.168.1.62 advertised-routes statistics
# Display statistics for BGP IPv4 multicast routes received from peer 192.168.1.62.
<Sysname> display bgp routing-table ipv4 multicast peer 192.168.1.62 received-routes statistics
Table 19 Command output
Field |
Description |
Advertised routes total |
Total number of advertised routes. |
Received routes total |
Total number of received routes. |
# Display BGP IPv4 multicast route statistics.
<Sysname> display bgp routing-table ipv4 multicast statistics
Table 20 Command output
Field |
Description |
Total number of routes |
Total number of routes. |
# Display advertisement information for the BGP IPv4 multicast route destined to network 8.8.8.8/32.
<Sysname> display bgp routing-table ipv4 multicast 8.8.8.8 32 advertise-info
BGP local router ID: 192.168.1.139
Local AS number: 100
BGP routing table information of 8.8.8.8/32:
Advertised to peers (1 in total):
Table 21 Command output
Field |
Description |
BGP local router ID |
Local BGP router ID. |
Local AS number |
Local AS number. |
Paths |
Number of optimal routes to the destination. |
BGP routing table information of 8.8.8.8/32 |
Advertisement information for network 8.8.8.8/32. |
Advertised to peers (1 in total) |
Peers to which the network has been advertised. |
ip as-path
ip community-list
display bgp routing-table ipv4 rtfilter
Use display bgp routing-table ipv4 rtfilter to display BGP IPv4 RT filter routing information.
Syntax
display bgp [ instance instance-name ] routing-table ipv4 rtfilter [ default-rt [ advertise-info ] | [ origin-as as-number ] [ route-target [ advertise-info ] ] | peer ipv4-address { advertised-routes | received-routes } [ default-rt | [ origin-as as-number ] [ route-target ] | 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 IPv4 RT filter routing information for the default BGP instance.
default-rt: Displays BGP IPv4 RT filter routing information for an all-zero RT.
origin-as as-number: Specifies an origin AS by its number.
route-target: Specifies an RT, a string of 3 to 21 characters.
An RT has the following formats:
· 16-bit AS number:32-bit user-defined number. For example, 101: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.
advertise-info: Displays advertisement information for BGP IPv4 RT filter routes.
peer ipv4-address: Displays BGP IPv4 RT filter routing information advertised to or received from the specified peer.
advertised-routes: Displays BGP IPv4 RT filter routing information advertised to the specified peer.
received-routes: Displays BGP IPv4 RT filter routing information received from the specified peer.
statistics: Displays routing statistics.
Usage guidelines
If you do not specify any parameters, this command displays brief information about all BGP IPv4 RT filter routes.
Examples
# Display brief information about all BGP IPv4 RT filter routes.
<Sysname> display bgp routing-table ipv4 rtfilter
BGP local router ID is 192.168.1.136
Status codes: * - valid, > - best, d - dampened, h - history
s - suppressed, S - stale, i - internal, e - external
Origin: i - IGP, e - EGP, ? - incomplete
Total number of routes from all PEs: 2
Origin AS: 100
Total number of routes: 2
* >e Network : <100:1> PrefixLen : 96
NextHop : 1.1.1.2 LocPrf :
PrefVal : 0
MED :
Path/Ogn: 100i
* >e Network : <1.1.1.1:1> PrefixLen : 96
NextHop : 1.1.1.2 LocPrf :
PrefVal : 0
MED :
Path/Ogn: 100i
# Display information about BGP IPv4 RT filter routes that match origin AS 100.
<Sysname> display bgp routing-table ipv4 rtfilter origin-as 100
BGP local router ID is 192.168.1.136
Status codes: * - valid, > - best, d - dampened, h - history
s - suppressed, S - stale, i - internal, e - external
Origin: i - IGP, e - EGP, ? - incomplete
Origin AS: 100
Total number of routes: 2
* >e Network : <100:1> PrefixLen : 96
NextHop : 1.1.1.2 LocPrf :
PrefVal : 0
MED :
Path/Ogn: 100i
* >e Network : <1.1.1.1:1> PrefixLen : 96
NextHop : 1.1.1.2 LocPrf :
PrefVal : 0
MED :
Path/Ogn: 100i
# Display information about all public BGP IPv4 RT filter routes advertised to peer 10.2.1.2.
<Sysname> display bgp routing-table ipv4 rtfilter peer 10.2.1.2 advertised-routes
Total number of routes: 1
BGP local router ID is 192.168.1.136
Status codes: * - valid, > - best, d - dampened, h - history
s - suppressed, S - stale, i - internal, e - external
Origin: i - IGP, e - EGP, ? - incomplete
Origin AS: 100
Total number of routes: 1
* > Network : <100:1> PrefixLen : 96
NextHop : 1.1.1.2 LocPrf :
MED : 0
Path/Ogn: i
# Display information about all public BGP IPv4 RT filter routes received from peer 10.2.1.2.
<Sysname> display bgp routing-table ipv4 rtfilter peer 10.2.1.2 received-routes
Total number of routes: 1
BGP local router ID is 192.168.1.135
Status codes: * - valid, > - best, d - dampened, h - history
s - suppressed, S - stale, i - internal, e - external
Origin: i - IGP, e - EGP, ? - incomplete
Origin AS: 100
Total number of routes: 1
* >e Network : <100:1> PrefixLen : 96
NextHop : 10.1.1.1 LocPrf :
PrefVal : 0
MED : 0
Path/Ogn: 100i
Table 22 Command output
Field |
Description |
Origin AS |
Origin AS of the RT filter routes. |
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. |
Origin |
Origin of the route: · i – IGP—Originated in the AS. The origin of routes advertised with the network command is IGP. · e – EGP—Learned through EGP. · ?– incomplete—Unknown origin. The origin of routes redistributed from IGP protocols is INCOMPLETE. |
Network |
Destination network address. |
NextHop |
Next hop IP address. |
MED |
MULTI_EXIT_DISC attribute. |
LocPrf |
Local preference value. |
PrefVal |
Preferred value of the route. |
Path/Ogn |
AS_PATH and ORIGIN attributes of the route: · AS_PATH—Records the ASs the route has passed. · ORIGIN—Identifies the origin of the route. |
# Display detailed information about BGP IPv4 RT filter route 100:1.
<Sysname> display bgp routing-table ipv4 rtfilter 100:1
BGP local router ID: 192.168.100.1
Local AS number: 100
Origin AS: 100
Total number of routes: 1
Paths: 1 available, 1 best
BGP routing table information of <100:1>/96:
Imported route.
Original nexthop: 10.2.1.1
OutLabel : NULL
AS-path : (null)
Origin : igp
Attribute value : MED 0, pref-val 32768, pre 0
State : valid, local, best
IP precedence : N/A
QoS local ID : N/A
Traffic index : N/A
VPN-Peer UserID : N/A
DSCP : N/A
Table 23 Command output
Field |
Description |
Paths |
Number of routes: · available—Number of valid routes. · best—Number of optimal routes. |
Imported route |
The BGP RT filter route is locally generated. |
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. |
OutLabel |
Outgoing label of the route. |
AS-path |
AS_PATH attribute of the route. |
Origin |
Origin of the route: · igp—Originated in the AS. The origin of routes advertised with the network command is IGP. · egp—Learned through EGP. · incomplete—Unknown origin. The origin of routes redistributed from IGP protocols is INCOMPLETE. |
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. |
From |
IP address of BGP peer that advertised the route. |
Rely Nexthop |
Next hop found by route recursion. If no next hop is found, this field displays not resolved. |
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. |
VPN-Peer UserID |
VPN peer ID in the range of 1 to 134217727. N/A indicates that the route does not support this field. |
DSCP |
DSCP value in the range of 0 to 63. N/A indicates that the route does not support this field. |
Backup route |
The route is a backup route. |
# Display statistics for BGP IPv4 RT filter routes advertised to peer 10.2.1.2.
<Sysname> display bgp routing-table ipv4 rtfilter peer 10.2.1.2 advertised-routes statistics
Advertised routes total: 2
# Display statistics for BGP IPv4 RT filter routes received from peer 10.2.1.2.
<Sysname> display bgp routing-table ipv4 rtfilter peer 10.2.1.2 received-routes statistics
Received routes total: 2
Table 24 Command output
Field |
Description |
Advertised routes total |
Total number of advertised routes. |
Received routes total |
Total number of received routes. |
# Display BGP IPv4 RT filter route statistics.
<Sysname> display bgp routing-table ipv4 rtfilter statistics
Total number of routes from all PEs: 6
Origin AS: 100
Total number of routes: 2
Origin AS: 200
Total number of routes: 4
# Display advertisement information for the BGP IPv4 RT filter route 1.1.1.1:1/96.
<Sysname> display bgp routing-table ipv4 rtfilter 1.1.1.1:1 advertise-info
BGP local router ID: 192.168.100.1
Local AS number: 100
Paths: 1 best
Origin AS: 100
Total number of routes: 1
Paths: 1 best
BGP route-target filter information of <1.1.1.1:1>/96:
Advertised to VPN peers (1 in total):
1.1.1.2
Origin AS: 200
Total number of routes: 1
Paths: 1 best
BGP route-target filter information of <1.1.1.1:1>/96:
Advertised to VPN peers (1 in total):
1.1.1.2
Table 25 Command output
Field |
Description |
Paths |
Number of optimal routes to the destination. |
BGP route-target filter information of <1.1.1.1:1>/96 |
Information about BGP IPv4 RT filter route 1.1.1.1:1/96. |
Advertised to VPN peers (1 in total) |
Peers to which the network has been advertised. |
display bgp routing-table ipv4 unicast
Use display bgp routing-table ipv4 unicast to display BGP IPv4 unicast routing information.
display bgp [ instance instance-name ] routing-table ipv4 [ unicast ] [ vpn-instance vpn-instance-name ] [ ipv4-address [ { mask-length | mask } [ longest-match ] ] | ipv4-address [ mask-length | mask ] advertise-info | as-path-acl as-path-acl-number | community-list { { basic-community-list-number | comm-list-name } [ whole-match ] | adv-community-list-number } | peer ipv4-address { advertised-routes | received-routes } [ ipv4-address [ mask-length | mask ] | statistics ] | statistics ]
network-admin
network-operator
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 IPv4 unicast routing information for the default BGP instance.
vpn-instance vpn-instance-name: Specifies an MPLS L3VPN instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command displays the BGP IPv4 unicast routing information for the public network.
ipv4-address: Specifies a destination network address.
mask-length: Specifies a mask length in the range of 0 to 32.
mask: Specifies a network mask in dotted decimal notation.
longest-match: Specifies longest match mode, which selects the longest matching route through the following steps:
1. ANDs the specified network address with the mask of each route.
2. Matches a route if the AND result is the same as the network address of the route and the mask of the route is shorter than or equal to the specified mask.
3. Selects the route with the longest mask among the matching routes.
advertise-info: Displays advertisement information for BGP IPv4 unicast routes.
as-path-acl as-path-acl-number: Displays BGP IPv4 unicast routes that match the AS path list specified by its number in the range of 1 to 256.
community-list: Displays BGP IPv4 unicast routes that match a community list.
basic-community-list-number: Specifies a basic community list by its number in the range of 1 to 99.
comm-list-name: Specifies a community list by its name, a case-sensitive string of 1 to 63 characters.
whole-match: Displays routes exactly matching the specified community list. If you do not specify this keyword, the command displays routes whose COMMUNITY attributes include the specified community list.
adv-community-list-number: Specifies an advanced community list by its number in the range of 100 to 199.
peer ipv4-address: Displays BGP IPv4 unicast routing information advertised to or received from the specified peer.
advertised-routes: Displays routing information advertised to the specified peer.
received-routes: Displays routing information received from the specified peer.
statistics: Displays routing statistics.
If you do not specify any parameters, this command displays brief information about all BGP IPv4 unicast routes.
If you specify only the ipv4-address argument, the system ANDs the network address with the mask of a route. If the result matches the network address of the route, the command displays information about the route.
If you specify the ipv4-address mask or ipv4-address mask-length argument and do not specify the longest-match keyword, this command displays information about the BGP IPv4 unicast route that matches both the specified destination network address and the mask (or mask length).
This command displays BGP IPv4 unicast routing information regardless of whether the unicast keyword is specified.
# Display brief information about all BGP IPv4 unicast routes.
<Sysname> display bgp routing-table ipv4
BGP local router ID is 192.168.100.1
Status codes: * - valid, > - best, d - dampened, h - history
s - suppressed, S - stale, i - internal, e - external
Origin: i - IGP, e - EGP, ? - incomplete
Network NextHop MED LocPrf PrefVal Path/Ogn
* > 10.2.1.0/24 10.2.1.1 0 0 i
e 10.2.1.2 0 0 4294967295
4294967294 4294967293 4294967292 4294967291 4294967290 4294967215 4294967225 4294967235 4294967245 4294967295 4294967294 4294967293 4294967292 4294967291 4294967290 i
* > 192.168.1.0 192.168.1.135 0 0 i
* e 10.2.1.2 0 0 200i
# Display information about BGP IPv4 unicast routes that match AS path list 1.
<Sysname> display bgp routing-table ipv4 as-path-acl 1
BGP local router ID is 2.2.2.2
Status codes: * - valid, > - best, d - dampened, h - history
s - suppressed, S - stale, i - internal, e - external
Origin: i - IGP, e - EGP, ? - incomplete
Network NextHop MED LocPrf PrefVal Path/Ogn
* >e 30.1.1.0/24 20.1.1.1 0 200i
# Display information about all public BGP IPv4 unicast routes advertised to peer 10.2.1.2.
<Sysname> display bgp routing-table ipv4 peer 10.2.1.2 advertised-routes
BGP local router ID is 192.168.100.1
Status codes: * - valid, > - best, d - damped, h - history
s - suppressed, S - Stale, i - internal, e - external
Origin: i - IGP, e - EGP, ? - incomplete
Network NextHop MED LocPrf PrefVal Path/Ogn
* > 10.2.1.0/24 10.2.1.1 0 0 i
* > 192.168.1.0 192.168.1.135 0 0 i
# Display information about all public BGP IPv4 unicast routes received from peer 10.2.1.2.
<Sysname> display bgp routing-table ipv4 peer 10.2.1.2 received-routes
BGP local router ID is 192.168.100.1
Status codes: * - valid, > - best, d - damped, h - history
s - suppressed, S - Stale, i - internal, e - external
Origin: i - IGP, e - EGP, ? - incomplete
Network NextHop MED LocPrf PrefVal Path/Ogn
e 10.2.1.0/24 10.2.1.2 0 0 200i
* e 192.168.1.0 10.2.1.2 0 0 200i
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. |
Origin |
Origin of the route: · i – IGP—Originated in the AS. The origin of routes advertised with the network command is IGP. · e – EGP—Learned through EGP. · ?– incomplete—Unknown origin. The origin of routes redistributed from IGP protocols is INCOMPLETE. |
Network |
Destination network address. |
NextHop |
Next hop IP address. |
MED |
MULTI_EXIT_DISC attribute. |
LocPrf |
Local preference value. |
PrefVal |
Preferred value of the route. |
Path/Ogn |
AS_PATH and ORIGIN attributes of the route: · AS_PATH—Records the ASs the route has passed, which avoids routing loops. This field can display a maximum of 16 AS numbers. More AS numbers are omitted and can be viewed in the detailed route information. · ORIGIN—Identifies the origin of the route. |
# Display detailed information about BGP IPv4 unicast routes destined to network 10.2.1.0/24.
<Sysname> display bgp routing-table ipv4 10.2.1.0 24
BGP local router ID: 192.168.100.1
Local AS number: 100
BGP routing table information of 10.2.1.0/24:
Imported route.
Original nexthop: 10.2.1.1
OutLabel : NULL
AS-path : (null)
Origin : igp
Attribute value : MED 0, pref-val 0, pre 0
State : valid, local, best
Originator : 176.1.1.2
Cluster list : 80
IP precedence : N/A
QoS local ID : N/A
Traffic index : N/A
VPN-Peer UserID : N/A
DSCP : N/A
EXP : N/A
From : 10.2.1.2 (192.168.100.2)
Rely nexthop : not resolved
Original nexthop: 10.2.1.2
OutLabel : NULL
AS-path : 200
Origin : igp
Attribute value : MED 0, pref-val 0, pre 255
State : external
IP precedence : N/A
QoS local ID : N/A
Traffic index : N/A
VPN-Peer UserID : N/A
DSCP : N/A
EXP : N/A
# Display detailed information about the BGP IPv4 unicast route destined to address 1.1.1.1/32.
<Sysname> display bgp routing-table ipv4 1.1.1.1 32
BGP local router ID: 192.168.100.1
Local AS number: 100
BGP routing table information of 1.1.1.1/32:
From : 10.2.1.1 (192.168.100.3)
Rely nexthop : 10.2.1.1
Original nexthop: 10.2.1.1
OutLabel : NULL
AS-path : (null)
Origin : igp
Attribute value : MED 0, pref-val 0, pre 0
State : valid, local, best
IP precedence : N/A
QoS local ID : N/A
Traffic index : N/A
VPN-Peer UserID : N/A
DSCP : N/A
EXP : N/A
Backup route.
From : 10.2.1.2 (192.168.100.2)
Rely nexthop : 10.2.1.2
Original nexthop: 10.2.1.2
OutLabel : NULL
AS-path : 200
Origin : igp
Attribute value : MED 0, pref-val 0, pre 255
State : external
IP precedence : N/A
QoS local ID : N/A
Traffic index : N/A
VPN-Peer UserID : N/A
DSCP : N/A
EXP : N/A
Table 27 Command output
Field |
Description |
Paths |
Number of routes: · available—Number of valid routes. · best—Number of optimal routes. |
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. |
OutLabel |
Outgoing label of the route. |
AS-path |
AS_PATH attribute of the route, which records the ASs the route has passed and avoids routing loops. |
Origin |
Origin of the route: · igp—Originated in the AS. The origin of routes advertised with the network command is IGP. · egp—Learned through EGP. · incomplete—Unknown origin. The origin of routes redistributed from IGP protocols is INCOMPLETE. |
PrefixSID |
Prefix SID: · Label index—Label index. · SRGB—SRGB range. |
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. |
Originator |
Router ID of the peer that advertised the route to the reflector. |
From |
IP address of the BGP peer that advertised the route. |
Rely Nexthop |
Next hop found by route recursion. If no next hop is found, this field displays not resolved. |
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. |
VPN-Peer UserID |
VPN peer ID in the range of 1 to 134217727. N/A indicates that the route does not support this field. |
DSCP |
DSCP value in the range of 0 to 63. N/A indicates that the route does not support this field. |
Backup route |
The route is a backup route. |
EXP |
MPLS EXP value of the route. N/A indicates that the route does not support this field. |
Tunnel policy |
Tunnel policy that takes effect. NULL indicates that no tunnel policy takes effect. |
Rely Tunnel IDs |
Tunnel index IDs after route recursion. This field displays multiple tunnel index IDs if ECMP tunnels exist and displays N/A if no tunnels are found by route recursion. |
# Display statistics for public BGP IPv4 unicast routes advertised to peer 10.2.1.2.
<Sysname> display bgp routing-table ipv4 peer 10.2.1.2 advertised-routes statistics
# Display statistics for public BGP IPv4 unicast routes received from peer 10.2.1.2.
<Sysname> display bgp routing-table ipv4 peer 10.2.1.2 received-routes statistics
Table 28 Command output
Field |
Description |
Advertised routes total |
Total number of advertised routes. |
Received routes total |
Total number of received routes. |
# Display BGP IPv4 unicast route statistics.
<Sysname> display bgp routing-table ipv4 statistics
Table 29 Command output
Field |
Description |
Total number of routes |
Total number of routes. |
# Display advertisement information for the BGP IPv4 unicast route destined to network 10.2.1.0/24.
<Sysname> display bgp routing-table ipv4 10.2.1.0 24 advertise-info
BGP local router ID: 192.168.100.1
Local AS number: 100
BGP routing table information of 10.2.1.0/24:
Advertised to peers (1 in total):
Table 30 Command output
Field |
Description |
BGP local router ID |
Local BGP router ID. |
Local AS number |
Local AS number. |
Paths |
Number of optimal routes to the destination. |
BGP routing table information of 10.2.1.0/24 |
Advertisement information for network 10.2.1.0/24. |
Advertised to peers (1 in total) |
Peers to which the network has been advertised. |
ip as-path
ip community-list
display bgp routing-table ipv6 multicast
Use display bgp routing-table ipv6 multicast to display BGP IPv6 multicast routing information.
display bgp [ instance instance-name ] routing-table ipv6 multicast [ ipv6-address prefix-length [ advertise-info ] | as-path-acl as-path-acl-number | community-list { { basic-community-list-number | comm-list-name } [ whole-match ] | adv-community-list-number } | peer ipv6-address { advertised-routes | received-routes } [ ipv6-address prefix-length | statistics ] | statistics ]
network-admin
network-operator
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 IPv6 multicast routing information for the default BGP instance.
ipv6-address prefix-length: Specifies the destination network address and prefix length. The value range for the prefix-length argument is 0 to 128. If you do not specify this argument, the command displays brief information about all BGP IPv6 multicast routing information.
advertise-info: Displays advertisement information for BGP IPv6 multicast routes. If you do not specify this keyword, the command displays the BGP IPv6 multicast routing table.
as-path-acl as-path-acl-number: Displays BGP IPv6 multicast routes that match the AS path list specified by its number in the range of 1 to 256.
community-list: Displays BGP IPv6 multicast routes that match a community list.
basic-community-list-number: Specifies a basic community list by its number in the range of 1 to 99.
comm-list-name: Specifies a community list by its name, a case-sensitive string of 1 to 63 characters.
whole-match: Displays BGP IPv6 multicast routes exactly matching the specified community list. If you do not specify this keyword, the command displays BGP IPv6 multicast routes whose COMMUNITY attributes include the specified community list.
adv-community-list-number: Specifies an advanced community list by its number in the range of 100 to 199.
peer: Displays BGP IPv6 multicast routing information advertised to or received from the specified peer.
ipv6-address: Specifies the peer IPv6 address.
advertised-routes: Displays BGP IPv6 multicast routing information advertised to the specified peer.
received-routes: Displays BGP IPv6 multicast routing information received from the specified peer.
statistics: Displays routing statistics.
# Display brief information about all BGP IPv6 multicast routes.
<Sysname> display bgp routing-table ipv6 multicast
BGP local router ID is 192.168.1.139
Status codes: * - valid, > - best, d - dampened, h - history
s - suppressed, S - stale, i - internal, e - external
Origin: i - IGP, e - EGP, ? - incomplete
* > Network : 1:: PrefixLen : 64
NextHop : :: LocPrf :
PrefVal : 32768 OutLabel : NULL
MED : 0
Path/Ogn: ?
* i Network : 1:: PrefixLen : 64
NextHop : 1::1 LocPrf : 100
PrefVal : 0 OutLabel : NULL
MED : 0
Path/Ogn: ?
* > Network : 1::2 PrefixLen : 128
NextHop : ::1 LocPrf :
PrefVal : 32768 OutLabel : NULL
MED : 0
Path/Ogn: ?
* > Network : 2::2 PrefixLen : 128
NextHop : ::1 LocPrf :
PrefVal : 32768 OutLabel : NULL
MED : 0
Path/Ogn: ?
* >i Network : 5::5 PrefixLen : 128
NextHop : 1::1 LocPrf : 100
PrefVal : 0 OutLabel : NULL
MED : 0
Path/Ogn: ?
# Display information about BGP IPv6 multicast routes that match AS path list 1.
<Sysname> display bgp routing-table ipv6 multicast as-path-acl 1
BGP local router ID is 192.168.1.139
Status codes: * - valid, > - best, d - dampened, h - history
s - suppressed, S - stale, i - internal, e - external
Origin: i - IGP, e - EGP, ? - incomplete
* > Network : 1:: PrefixLen : 64
NextHop : :: LocPrf :
PrefVal : 32768 OutLabel : NULL
MED : 0
Path/Ogn: ?
* i Network : 1:: PrefixLen : 64
NextHop : 1::1 LocPrf : 100
PrefVal : 0 OutLabel : NULL
MED : 0
Path/Ogn: ?
* > Network : 1::2 PrefixLen : 128
NextHop : ::1 LocPrf :
PrefVal : 32768 OutLabel : NULL
MED : 0
Path/Ogn: ?
* > Network : 2::2 PrefixLen : 128
NextHop : ::1 LocPrf :
PrefVal : 32768 OutLabel : NULL
MED : 0
Path/Ogn: ?
* >i Network : 5::5 PrefixLen : 128
NextHop : 1::1 LocPrf : 100
PrefVal : 0 OutLabel : NULL
MED : 0
Path/Ogn: ?
# Display information about BGP IPv6 multicast routes that match BGP community list 100.
<Sysname> display bgp routing-table ipv6 multicast community-list 100
BGP local router ID is 192.168.1.139
Status codes: * - valid, > - best, d - dampened, h - history
s - suppressed, S - stale, i - internal, e - external
Origin: i - IGP, e - EGP, ? - incomplete
* > Network : 1:: PrefixLen : 64
NextHop : :: LocPrf :
PrefVal : 32768 OutLabel : NULL
MED : 0
Path/Ogn: ?
* i Network : 1:: PrefixLen : 64
NextHop : 1::1 LocPrf : 100
PrefVal : 0 OutLabel : NULL
MED : 0
Path/Ogn: ?
* > Network : 1::2 PrefixLen : 128
NextHop : ::1 LocPrf :
PrefVal : 32768 OutLabel : NULL
MED : 0
Path/Ogn: ?
* > Network : 2::2 PrefixLen : 128
NextHop : ::1 LocPrf :
PrefVal : 32768 OutLabel : NULL
MED : 0
Path/Ogn: ?
* >i Network : 5::5 PrefixLen : 128
NextHop : 1::1 LocPrf : 100
PrefVal : 0 OutLabel : NULL
MED : 0
Path/Ogn: ?
# Display information about all BGP IPv6 multicast routes advertised to peer 1::1.
<Sysname> display bgp routing-table ipv6 multicast peer 1::1 advertised-routes
BGP local router ID is 192.168.1.139
Status codes: * - valid, > - best, d - dampened, h - history
s - suppressed, S - stale, i - internal, e - external
Origin: i - IGP, e - EGP, ? - incomplete
* > Network : 1:: PrefixLen : 64
NextHop : :: LocPrf : 100
MED : 0 OutLabel : NULL
Path/Ogn: ?
* > Network : 2::2 PrefixLen : 128
NextHop : ::1 LocPrf : 100
MED : 0 OutLabel : NULL
Path/Ogn: ?
# Display information about all BGP IPv6 multicast routes received from peer 1::1.
<Sysname> display bgp routing-table ipv6 multicast peer 1::1 received-routes
BGP local router ID is 192.168.1.139
Status codes: * - valid, > - best, d - dampened, h - history
s - suppressed, S - stale, i - internal, e - external
Origin: i - IGP, e - EGP, ? - incomplete
* i Network : 1:: PrefixLen : 64
NextHop : 1::1 LocPrf : 100
PrefVal : 0 OutLabel : NULL
MED : 0
Path/Ogn: ?
* >i Network : 5::5 PrefixLen : 128
NextHop : 1::1 LocPrf : 100
PrefVal : 0 OutLabel : NULL
MED : 0
Path/Ogn: ?
Table 31 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. |
Origin |
Origin of the route: · i – IGP—Originated in the AS. The origin of routes advertised with the network command is IGP. · e – EGP—Learned through EGP. · ?– incomplete—Unknown origin. The origin of routes redistributed from IGP protocols is INCOMPLETE. |
Network |
Destination network address. |
PrefixLen |
Prefix length of the destination network address. |
NextHop |
Next hop IP address. |
LocPrf |
Local preference value. |
PrefVal |
Preferred value of the route. |
OutLabel |
Outgoing label of the route. |
MED |
MULTI_EXIT_DISC 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. |
# Display detailed information about BGP IPv6 multicast routes destined to network 2::2/128.
<Sysname> display bgp routing-table ipv6 multicast 2::2 128
BGP local router ID: 192.168.1.139
Local AS number: 100
BGP routing table information of 2::2/128:
Imported route.
Original nexthop: ::1
OutLabel : NULL
AS-path : (null)
Origin : incomplete
Attribute value : MED 0, pref-val 32768
State : valid, local, best
Originator : 176.1.1.2
Cluster list : 80
IP precedence : N/A
QoS local ID : N/A
Traffic index : N/A
VPN-Peer UserID : N/A
DSCP : N/A
EXP : N/A
Table 32 Command output
Field |
Description |
Paths |
Number of routes: · available—Number of valid routes. · best—Number of optimal routes. |
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. |
OutLabel |
Outgoing label of the route. |
AS-path |
AS_PATH attribute of the route, which records the ASs the route has passed and avoids routing loops. |
Origin |
Origin of the route: · igp—Originated in the AS. The origin of routes advertised with the network command is IGP. · egp—Learned through EGP. · incomplete—Unknown origin. The origin of routes redistributed from IGP protocols is INCOMPLETE. |
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. |
Originator |
Router ID of the peer that advertised the route to the reflector. |
From |
IP address of the BGP peer that advertised the route. |
Rely Nexthop |
Next hop found by route recursion. If no next hop is found, this field displays not resolved. |
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. |
VPN-Peer UserID |
VPN peer ID in the range of 1 to 134217727. N/A indicates that the route does not support this field. |
DSCP |
DSCP value in the range of 0 to 63. N/A indicates that the route does not support this field. |
EXP |
MPLS EXP value of the route. N/A indicates that the route does not support this field. |
# Display advertisement information for BGP IPv6 multicast routes destined to network 2::2/128.
<Sysname> display bgp routing-table ipv6 multicast 2::2 128 advertise-info
BGP local router ID: 192.168.1.139
Local AS number: 100
BGP routing table information of 2::2/128:
Advertised to peers (1 in total):
Table 33 Command output
Field |
Description |
BGP local router ID |
Local BGP router ID. |
Local AS number |
Local AS number. |
Paths |
Number of optimal routes to the destination. |
BGP routing table information of 2::2/128 |
Advertisement information for network 2::2/128. |
Advertised to peers (1 in total) |
Peers to which the network has been advertised. |
# Display statistics for BGP IPv6 multicast routes advertised to peer 1::1.
<Sysname> display bgp routing-table ipv6 multicast peer 1::1 advertised-routes statistics
# Display statistics for BGP IPv6 multicast routes received from peer 1::1.
<Sysname> display bgp routing-table ipv6 multicast peer 1::1 received-routes statistics
Table 34 Command output
Field |
Description |
Advertised routes total |
Total number of advertised routes. |
Received routes total |
Total number of received routes. |
# Display BGP IPv6 multicast route statistics.
<Sysname> display bgp routing-table ipv6 multicast statistics
Table 35 Command output
Field |
Description |
Total number of routes |
Total number of routes. |
ip as-path
ip community-list
display bgp routing-table ipv6 unicast
Use display bgp routing-table ipv6 unicast to display BGP IPv6 unicast routing information.
display bgp [ instance instance-name ] routing-table ipv6 [ unicast ] [ vpn-instance vpn-instance-name ] [ ipv6-address prefix-length [ advertise-info ] | as-path-acl as-path-acl-number | community-list { { basic-community-list-number | comm-list-name } [ whole-match ] | adv-community-list-number } | peer ipv6-address { advertised-routes | received-routes } [ ipv6-address prefix-length | statistics ] | statistics ]
display bgp [ instance instance-name ] routing-table ipv6 [ unicast ] peer ipv4-address { advertised-routes | received-routes } [ ipv6-address prefix-length | statistics ]
network-admin
network-operator
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 IPv6 unicast routing information for the default BGP instance.
vpn-instance vpn-instance-name: Specifies an MPLS L3VPN instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command displays the BGP IPv6 unicast routing information for the public network.
ipv6-address prefix-length: Specifies the destination network address and prefix length. The value range for the prefix-length argument is 0 to 128. If you do not specify this argument, the command displays brief information about all BGP IPv6 unicast routing information.
advertise-info: Displays advertisement information for BGP IPv6 unicast routes. If you do not specify this keyword, the command displays the BGP IPv6 unicast routing table.
as-path-acl as-path-acl-number: Displays BGP IPv6 unicast routes that match the AS path list specified by its number in the range of 1 to 256.
community-list: Displays BGP IPv6 unicast routes that match a community list.
basic-community-list-number: Specifies a basic community list by its number in the range of 1 to 99.
comm-list-name: Specifies a community list by its name, a case-sensitive string of 1 to 63 characters.
whole-match: Displays routes exactly matching the specified community list. If you do not specify this keyword, the command displays routes whose COMMUNITY attributes include the specified community list.
adv-community-list-number: Specifies an advanced community list by its number in the range of 100 to 199.
peer: Displays BGP IPv6 unicast routing information advertised to or received from the specified peer.
ipv4-address: Specifies the peer IPv4 address.
ipv6-address: Specifies the peer IPv6 address.
advertised-routes: Displays routing information advertised to the specified peer.
received-routes: Displays routing information received from the specified peer.
statistics: Displays routing statistics.
This command displays BGP IPv6 unicast routing information regardless of whether the unicast keyword is specified.
# Display brief information about all BGP IPv6 unicast routes.
<Sysname> display bgp routing-table ipv6
BGP local router ID is 192.168.1.136
Status codes: * - valid, > - best, d - dampened, h - history
s - suppressed, S - stale, i - internal, e - external
Origin: i - IGP, e - EGP, ? - incomplete
* >e Network : 3:: PrefixLen : 64
NextHop : 1::2 LocPrf :
PrefVal : 0 OutLabel : NULL
MED :
Path/Ogn: 4294967295 4294967294 4294967293 4294967292 4294967291 4294967290 4294967215 4294967225 4294967235 4294967245 4294967295 4294967294 4294967293 4294967292 4294967291 4294967290 i
# Display information about BGP IPv6 unicast routes that match AS path list 1.
<Sysname> display bgp routing-table ipv6 as-path-acl 1
BGP local router ID is 192.168.1.136
Status codes: * - valid, > - best, d - dampened, h - history
s - suppressed, S - stale, i - internal, e - external
Origin: i - IGP, e - EGP, ? - incomplete
* >e Network : 2:: PrefixLen : 64
NextHop : 1::2 LocPrf :
PrefVal : 0 OutLabel : NULL
MED :
Path/Ogn: 100i
* >e Network : 3:: PrefixLen : 64
NextHop : 1::2 LocPrf :
PrefVal : 0 OutLabel : NULL
MED :
Path/Ogn: 100i
# Display information about BGP IPv6 unicast routes that match BGP community list 100.
<Sysname> display bgp routing-table ipv6 community-list 100
BGP local router ID is 192.168.1.136
Status codes: * - valid, > - best, d - dampened, h - history
s - suppressed, S - stale, i - internal, e - external
Origin: i - IGP, e - EGP, ? - incomplete
* >e Network : 2:: PrefixLen : 64
NextHop : 1::2 LocPrf :
PrefVal : 0 OutLabel : NULL
MED :
Path/Ogn: 100i
* >e Network : 3:: PrefixLen : 64
NextHop : 1::2 LocPrf :
PrefVal : 0 OutLabel : NULL
MED :
Path/Ogn: 100i
# Display information about all BGP IPv6 unicast routes advertised to peer 1::1.
<Sysname> display bgp routing-table ipv6 peer 1::1 advertised-routes
BGP local router ID is 192.168.1.136
Status codes: * - valid, > - best, d - dampened, h - history
s - suppressed, S - stale, i - internal, e - external
Origin: i - IGP, e - EGP, ? - incomplete
* > Network : 2:: PrefixLen : 64
NextHop : :: LocPrf :
MED : 0 OutLabel : NULL
Path/Ogn: i
# Display information about all BGP IPv6 unicast routes received from peer 1::1.
<Sysname> display bgp routing-table ipv6 peer 1::1 received-routes
BGP local router ID is 192.168.1.135
Status codes: * - valid, > - best, d - dampened, h - history
s - suppressed, S - stale, i - internal, e - external
Origin: i - IGP, e - EGP, ? - incomplete
* >e Network : 2:: PrefixLen : 64
NextHop : ::FFFF:10.1.1.1 LocPrf :
PrefVal : 0 OutLabel : NULL
MED : 0
Path/Ogn: 100i
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. |
Origin |
Origin of the route: · i – IGP—Originated in the AS. The origin of routes advertised with the network command is IGP. · e – EGP—Learned through EGP. · ?– incomplete—Unknown origin. The origin of routes redistributed from IGP protocols is INCOMPLETE. |
Network |
Destination network address. |
PrefixLen |
Prefix length of the destination network address. |
NextHop |
Next hop IPv6 address. |
LocPrf |
Local preference value. |
PrefVal |
Preferred value of the route. |
OutLabel |
Outgoing label of the route. |
MED |
MULTI_EXIT_DISC attribute. |
Path/Ogn |
AS_PATH and ORIGIN attributes of the route: · AS_PATH attribute—Records the ASs the route has passed, which avoids routing loops. This field can display a maximum of 16 AS numbers. More AS numbers are omitted and can be viewed in the detailed route information. · ORIGIN attribute—Identifies the origin of the route. |
# Display detailed information about BGP IPv6 unicast routes destined to network 2::/64.
<Sysname> display bgp routing-table ipv6 2:: 64
BGP local router ID: 192.168.1.135
Local AS number: 200
BGP routing table information of 2::/64:
From : 10.1.1.1 (192.168.1.136)
Relay nexthop : ::FFFF:10.1.1.1
Original nexthop: ::FFFF:10.1.1.1
OutLabel : NULL
AS-path : 100
Origin : igp
Attribute value : MED 0, pref-val 0
State : valid, external, best
Originator : 176.1.1.2
Cluster list : 80
IP precedence : N/A
QoS local ID : N/A
Traffic index : N/A
VPN-Peer UserID : N/A
DSCP : N/A
EXP : N/A
Backup route.
Relay nexthop : 1::1
Original nexthop: 1::1
OutLabel : NULL
AS-path : 100
Origin : igp
Attribute value : MED 0, pref-val 0
State : valid, external
IP precedence : N/A
QoS local ID : N/A
Traffic index : N/A
VPN-Peer UserID : N/A
DSCP : N/A
EXP : N/A
Table 37 Command output
Field |
Description |
Paths |
Number of routes: · available—Number of valid routes. · best—Number of optimal routes. |
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. |
OutLabel |
Outgoing label of the route. |
AS-path |
AS_PATH attribute of the route, which records the ASs the route has passed and avoids routing loops. |
Origin |
Origin of the route: · igp—Originated in the AS. The origin of routes advertised with the network command is IGP. · egp—Learned through EGP. · incomplete—Unknown origin. The origin of routes redistributed from IGP protocols is INCOMPLETE. |
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. · best. |
Originator |
Router ID of the peer that advertised the route to the reflector. |
From |
IP address of the BGP peer that advertised the route. |
Relay Nexthop |
Next hop found by route recursion. If no next hop is found, this field displays not resolved. |
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. |
VPN-Peer UserID |
VPN peer ID in the range of 1 to 134217727. N/A indicates that the route does not support this field. |
DSCP |
DSCP value in the range of 0 to 63. N/A indicates that the route does not support this field. |
Backup route |
The route is a backup route. |
EXP |
MPLS EXP value of the route. N/A indicates that the route does not support this field. |
Tunnel policy |
Tunnel policy that takes effect. NULL indicates that no tunnel policy takes effect. |
Rely Tunnel IDs |
Tunnel index IDs after route recursion. This field displays multiple tunnel index IDs if ECMP tunnels exist and displays N/A if no tunnels are found by route recursion. |
# Display advertisement information for BGP IPv6 unicast routes destined to network 2::/64.
<Sysname> display bgp routing-table ipv6 2:: 64 advertise-info
BGP local router ID: 192.168.1.136
Local AS number: 100
BGP routing table information of 2::/64:
Advertised to peers (2 in total):
10.1.1.2
1::2
Table 38 Command output
Field |
Description |
Paths |
Number of optimal routes destined to the specified network. |
BGP routing table information of 2::/64 |
Advertisement information for BGP routes destined to network 2::/64. |
Advertised to peers (2 in total) |
Peers to which the route has been advertised, and the number of peers. |
# Display statistics for BGP IPv6 unicast routes advertised to peer 1::1.
<Sysname> display bgp routing-table ipv6 peer 1::1 advertised-routes statistics
# Display statistics for BGP IPv6 unicast routes received from peer 1::1.
<Sysname> display bgp routing-table ipv6 peer 1::1 received-routes statistics
Table 39 Command output
Field |
Description |
Advertised routes total |
Total number of advertised routes. |
Received routes total |
Total number of received routes. |
# Display BGP IPv6 unicast route statistics.
<Sysname> display bgp routing-table ipv6 statistics
Table 40 Command output
Field |
Description |
Total number of routes |
Total number of routes. |
ip as-path
ip community-list
display bgp routing-table ipv6 unicast inlabel
Use display bgp routing-table ipv6 unicast inlabel to display incoming labels for BGP IPv6 unicast routes.
display bgp [ instance instance-name ] routing-table ipv6 [ unicast ] inlabel
network-admin
network-operator
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 incoming labels of BGP IPv6 unicast routes in the default BGP instance.
This command displays incoming labels for BGP IPv6 unicast routes regardless of whether the unicast keyword is specified.
# Display incoming labels for all BGP IPv6 unicast routes.
<Sysname> display bgp routing-table ipv6 inlabel
BGP local router ID is 2.2.2.2
Status codes: * - valid, > - best, d - dampened, h - history
s - suppressed, S - stale, i - internal, e - external
Origin: i - IGP, e - EGP, ? - incomplete
* > Network : 1::1 PrefixLen : 128
NextHop : 10::1 OutLabel : NULL
InLabel : 1279
* > Network : 10:: PrefixLen : 64
NextHop : :: OutLabel : NULL
Table 41 Command output
Field |
Description |
Status codes |
Status codes. For more information, see Table 36. |
Origin |
Origin of the route. For more information, see Table 36. |
Network |
Destination network address. |
PrefixLen |
Prefix length of the destination network address. |
NextHop |
Next hop IPv6 address. |
OutLabel |
Outgoing label of the IPv6 unicast route, which is assigned by the peer 6PE device. |
InLabel |
Incoming label of the IPv6 unicast route, which is assigned by the local 6PE device. |
display bgp routing-table ipv6 unicast outlabel
Use display bgp routing-table ipv6 unicast outlabel to display outgoing labels for BGP IPv6 unicast routes.
display bgp [ instance instance-name ] routing-table ipv6 [ unicast ] outlabel
network-admin
network-operator
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 display outgoing labels of BGP IPv6 unicast routes in the default BGP instance.
This command displays outgoing labels for BGP IPv6 unicast routes regardless of whether the unicast keyword is specified.
# Display outgoing labels for all BGP IPv6 unicast routes.
<Sysname> display bgp routing-table ipv6 outlabel
BGP local router ID is 2.2.2.2
Status codes: * - valid, > - best, d - dampened, h - history
s - suppressed, S - stale, i - internal, e - external
Origin: i - IGP, e - EGP, ? - incomplete
* >i Network : 4::4 PrefixLen : 128
NextHop : ::FFFF:3.3.3.3 OutLabel : 1279
* >i Network : 20:: PrefixLen : 64
NextHop : ::FFFF:3.3.3.3 OutLabel : 1278
Table 42 Command output
Field |
Description |
Status codes |
Status codes. For more information, see Table 36. |
Origin |
Origin of the route. For more information, see Table 36. |
Network |
Destination network address. |
PrefixLen |
Prefix length of the destination network address. |
NextHop |
Next hop IPv6 address. |
OutLabel |
Outgoing label of the IPv6 unicast route, which is assigned by the peer 6PE device. |
display bgp update-group
Use display bgp update-group to display information about BGP update groups.
display bgp [ instance instance-name ] update-group ipv4 [ mdt | multicast | mvpn | rtfilter | [ unicast ] [ vpn-instance vpn-instance-name ] ] [ ipv4-address ]
display bgp [ instance instance-name ] update-group ipv6 [ multicast | [ unicast ] [ vpn-instance vpn-instance-name ] ] [ ipv6-address ]
display bgp [ instance instance-name ] update-group ipv6 [ unicast ] [ ipv4-address ]
display bgp [ instance instance-name ] update-group link-state [ ipv4-address | ipv6-address ]
display bgp [ instance instance-name ] update-group vpnv4 [ vpn-instance vpn-instance-name ] [ ipv4-address ]
display bgp [ instance instance-name ] update-group vpnv6 [ ipv4-address ]
network-admin
network-operator
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 update group information for the default BGP instance.
ipv4: Displays BGP update group information for IPv4 address family.
ipv6: Displays BGP update group information for IPv6 address family.
link-state: Displays BGP update group information for LS address family.
vpnv4: Displays BGP update group information for VPNv4 address family.
vpnv6: Displays BGP update group information for VPNv6 address family.
mdt: Displays BGP update group information for MDT address family.
multicast: Displays BGP update group information for multicast address family.
mvpn: Displays BGP update group information for MVPN address family.
rtfilter: Displays BGP update group information for BGP IPv4 RT filter address family.
unicast: Displays BGP update group information for unicast address family.
vpn-instance vpn-instance-name: Displays BGP update group information for the MPLS L3VPN instance specified by its name, a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command displays update group information for the public network.
ipv4-address: Displays BGP update group information for the specified BGP peer.
ipv6-address: Displays BGP update group information for the specified IPv6 BGP peer.
The update group feature classifies BGP peers that have the same export policy into an update group. When BGP advertises routes to the peers in the update group, it uses the export policy to filter the routes and generates route updates for all the peers only once.
With this feature, BGP performs one-time policy filtering and encapsulation for a prefix before advertising the prefix to all the peers in the update group. For example, BGP advertises 1000 prefixes to 1000 peers that have the same export policy (in data centers for example). Without the update group feature, BGP matches the export policy 1000 × 1000 times. With the update group feature, BGP matches the export policy only 1000 × 1 times, improving encapsulation efficiency 1000 times.
If you do not specify any parameters, this command displays all update groups for the specified address family on the public network.
By default, the unicast keyword is used if the unicast, mdt, mvpn, rtfilter, and multicast keywords are not specified.
# Display information about all BGP update groups for the IPv4 unicast address family.
<Sysname> display bgp update-group ipv4
Type: EBGP link
4-byte AS number: Supported
Site-of-Origin: Not specified
Minimum time between advertisements: 30 seconds
OutQ: 0
Members: 1
99.1.1.1
# Display update group information for BGP VPNv4 peer 1.1.1.2 in VPN instance vpn1.
<Sysname> display bgp update-group vpnv4 vpn-instance vpn1 1.1.1.2
Type: EBGP link
4-byte AS number: Supported
Site-of-Origin: Not specified
Nesting VPN: vpn1
Minimum time between advertisements: 30 seconds
OutQ: 0
Members: 2
1.1.1.2
1.1.1.3
Table 43 Command output
Field |
Description |
Update-group ID |
ID of the update group. |
Type |
BGP link type: · IBGP link. · EBGP link. · Confed IBGP link—Confederation IBGP link. · Confed EBGP link—Confederation EBGP link. |
Label capability: Supported |
This field is not supported in the current software version. The peers in the update group support labeled routes. |
4-byte AS number: Supported |
4-byte AS number suppression is disabled for the peers in the update group. The peers in the update group support 4-byte AS numbers. |
4-byte AS number: Suppressed |
4-byte AS number suppression is enabled for the peers in the update group. |
Fake AS |
A fake local AS number is configured for the peers in the update group. |
Public-AS-Only: Yes |
BGP route updates advertised to the peers in the update group only carry the public AS number without the private AS number. · Yes—If a peer uses a private AS number, the AS number is used as an update group classification criterion. If a peer uses a public AS number, the AS number is not used as an update group classification criterion. · No—The AS number is not used as an update group classification criterion. |
Substitute-AS: Yes |
This field is not supported in the current software version. AS number substitution is enabled. |
Minimum time between advertisements: number seconds |
Minimum time between advertisements. |
Advertising community: Yes |
Community advertisement to peers in the update group is enabled. |
Route-reflect client: Yes |
The peer is a client of the route reflector. |
Advertising extended community: Yes |
Extended community advertisement to peers in the update group is enabled. |
Export AS-path-ACL |
AS path ACL used to filter BGP routes advertised to peers in the update group. |
Export prefix list |
Prefix list used to filter BGP routes advertised to peers in the update group. |
Export route policy |
Routing policy used to filter BGP routes advertised to peers in the update group. |
Export filter-policy |
ACL used to filter BGP routes advertised to peers in the update group. |
OutQ |
Number of prefixes to be advertised to peers in the update group. |
Members |
Number and IP addresses of peers in the update group. |
Nesting VPN |
Peers in the update group support nesting VPN. |
UPE: Yes |
Peers in the update group are UPE devices. |
UPE export route policy |
An outgoing routing policy is applied to peers in the update group. |
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-VPN IPv4 unicast address family view
BGP IPv6 unicast address family view
BGP-VPN 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
filter-policy export
Use filter-policy export to filter advertised BGP routes.
Use undo filter-policy export to remove the route filter.
In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view/BGP VPNv4 address family view/BGP IPv4 multicast address family view:
filter-policy { ipv4-acl-number | prefix-list ipv4-prefix-list-name } export [ direct | { ospf | rip } process-id | static ]
undo filter-policy export [ direct | { ospf | rip } process-id | static ]
In BGP IPv6 unicast address family view/BGP-VPN IPv6 unicast address family view/BGP VPNv6 address family view/BGP IPv6 multicast address family view:
filter-policy { ipv6-acl-number | prefix-list ipv6-prefix-list-name } export [ direct | { ospfv3 | ripng } process-id | static ]
undo filter-policy export [ direct | { ospfv3 | ripng } process-id | static ]
Advertised BGP routes are not filtered.
BGP IPv4 unicast address family view
BGP-VPN IPv4 unicast address family view
BGP VPNv4 address family view
BGP IPv6 unicast address family view
BGP-VPN IPv6 unicast address family view
BGP VPNv6 address family view
BGP IPv4 multicast address family view
BGP IPv6 multicast address family view
network-admin
ipv4-acl-number: Specifies an IPv4 ACL by its number in the range of 2000 to 3999, to match routes by destination.
ipv6-acl-number: Specifies an IPv6 ACL by its number in the range of 2000 to 3999, to match routes by destination.
prefix-list ipv4-prefix-list-name: Specifies an IPv4 prefix list by its name, a case-sensitive string of 1 to 63 characters, to match routes by destination.
prefix-list ipv6-prefix-list-name: Specifies an IPv6 prefix list by its name, a case-sensitive string of 1 to 63 characters, to match routes by destination.
direct: Filters direct routes.
ospf: Filters OSPF routes.
ospfv3: Filters OSPFv3 routes.
rip: Filters RIP routes.
ripng: Filters RIPng routes.
static: Filters static routes.
process-id: Specifies a routing protocol by its ID in the range of 1 to 65535.
If you specify a protocol(such as direct and rip), this command filters only routes redistributed from the specified protocol. If you do not specify a protocol, this command filters all advertised routes, including the following routes:
· Redistributed from IGP.
· Injected by the network command.
· Learned from BGP peers.
If you use a basic ACL (with a number from 2000 to 2999) configured with the rule [ rule-id ] { deny | permit } source source-address source-wildcard command, the command matches routes whose destination network addresses match the source-address source-wildcard argument. However, it does not match the masks of the destination addresses.
To use an advanced ACL (with a number from 3000 to 3999) in the command, configure the ACL using one of the following steps:
· To deny/permit a route with the specified destination, use the rule [ rule-id ] { deny | permit } ip source sour-addr sour-wildcard command.
· To deny/permit a route with the specified destination and mask, use the rule [ rule-id ] { deny | permit } ip source sour-addr sour-wildcard destination dest-addr dest-wildcard command.
The source keyword specifies the destination address of a route and the destination keyword specifies the subnet mask of the destination address. For the mask configuration to take effect, specify a contiguous subnet mask.
# In BGP IPv4 unicast address family view, use IPv4 basic ACL 2000 to filter advertised BGP IPv4 routes.
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] filter-policy 2000 export
filter-policy import
peer as-path-acl
peer filter-policy
peer prefix-list
peer route-policy
filter-policy import
Use filter-policy import to filter received BGP routes.
Use undo filter-policy import to restore the default.
In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view/BGP VPNv4 address family view/BGP IPv4 multicast address family view:
filter-policy { ipv4-acl-number | prefix-list ipv4-prefix-list-name } import
undo filter-policy import
In BGP IPv6 unicast address family view/BGP-VPN IPv6 unicast address family view/BGP VPNv6 address family view/BGP IPv6 multicast address family view:
filter-policy { ipv6-acl-number | prefix-list ipv6-prefix-list-name } import
undo filter-policy import
Received BGP routes are not filtered.
BGP IPv4 unicast address family view
BGP-VPN IPv4 unicast address family view
BGP VPNv4 address family view
BGP IPv6 unicast address family view
BGP-VPN IPv6 unicast address family view
BGP VPNv6 address family view
BGP IPv4 multicast address family view
BGP IPv6 multicast address family view
network-admin
ipv4-acl-number: Specifies an IPv4 ACL by its number in the range of 2000 to 3999, to match routes by destination.
ipv6-acl-number: Specifies an IPv6 ACL by its number in the range of 2000 to 3999, to match routes by destination.
prefix-list ipv4-prefix-list-name: Specifies an IPv4 prefix list by its name, a case-sensitive string of 1 to 63 characters, to match routes by destination.
prefix-list ipv6-prefix-list-name: Specifies an IPv6 prefix list by its name, a case-sensitive string of 1 to 63 characters, to match routes by destination.
If you use a basic ACL (with a number from 2000 to 2999) configured with the rule [ rule-id ] { deny | permit } source source-address source-wildcard command, the command matches routes whose destination network addresses match the source-address source-wildcard argument. However, it does not match the masks of the destination addresses.
To use an advanced ACL (with a number from 3000 to 3999) in the command, configure the ACL using one of the following steps:
· To deny/permit a route with the specified destination, use the rule [ rule-id ] { deny | permit } ip source sour-addr sour-wildcard command.
· To deny/permit a route with the specified destination and mask, use the rule [ rule-id ] { deny | permit } ip source sour-addr sour-wildcard destination dest-addr dest-wildcard command.
The source keyword specifies the destination address of a route and the destination keyword specifies the subnet mask of the destination address. For the mask configuration to take effect, specify a contiguous subnet mask.
# In BGP IPv4 unicast address family view, use IPv4 basic ACL 2000 to filter received BGP routes.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] filter-policy 2000 import
filter-policy export
peer as-path-acl
peer filter-policy
peer prefix-list
peer 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 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 180 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
group
Use group to create a peer group.
Use undo group to delete a peer group.
group group-name [ external | internal ]
undo group group-name
No peer groups exist.
BGP-VPN instance view
network-admin
group-name: Specifies a name for the peer group, a case-sensitive string of 1 to 47 characters.
external: Creates an EBGP peer group.
internal: Creates an IBGP peer group.
In a large-scale network, many peers can use the same route selection policy. You can configure a peer group and add these peers into this group. In this way, peers can share the same policy as the peer group. When the policy of the group is modified, the modification also applies to peers in it.
If you do not specify the internal or external keyword, this command creates an IBGP peer group.
If you perform configurations on a peer group and peers of the peer group, the most recent configuration takes effect.
After you create a peer group, you must use the peer enable command to enable BGP to exchange routing information with the specified peer group.
# In BGP instance view, create EBGP peer group test with AS number 200, and add EBGP peers 10.1.1.1 and 10.1.2.1 into the group.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] group test external
[Sysname-bgp-default] peer test as-number 200
[Sysname-bgp-default] peer 10.1.1.1 group test
[Sysname-bgp-default] peer 10.1.2.1 group test
display bgp group
peer enable
ignore-first-as
Use ignore-first-as to configure BGP to ignore the first AS number of EBGP route updates.
Use undo ignore-first-as to restore the default.
ignore-first-as
undo ignore-first-as
BGP checks the first AS number of a received EBGP route update. If the first AS number is neither that of the BGP peer nor a private AS number, the BGP router disconnects the BGP session to the peer.
network-admin
# Configure BGP to ignore the first AS number of EBGP route updates.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] ignore-first-as
Related commands
peer ignore-first-as
import-route
Use import-route to enable BGP to redistribute routes from an IGP protocol.
Use undo import-route to disable route redistribution from an IGP protocol.
In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view/BGP IPv4 multicast address family view:
import-route { ospf | rip } [ { process-id | all-processes } [ allow-direct | med med-value | route-policy route-policy-name ] * ]
import-route { direct | guard | static } [ med med-value | route-policy route-policy-name ] *
undo import-route { direct | guard | { ospf | rip } [ process-id | all-processes ] | static }
In BGP IPv6 unicast address family view/BGP-VPN IPv6 unicast address family view/BGP IPv6 multicast address family view:
import-route { ospfv3 | ripng } [ { process-id | all-processes } [ allow-direct | med med-value | route-policy route-policy-name ] * ]
import-route { direct | guard | static } [ med med-value | route-policy route-policy-name ] *
undo import-route { direct | guard | { ospfv3 | ripng } [ process-id | all-processes ] | static }
BGP does not redistribute IGP routes.
BGP IPv4 unicast address family view
BGP-VPN IPv4 unicast address family view
BGP IPv6 unicast address family view
BGP-VPN IPv6 unicast address family view
BGP IPv4 multicast address family view
BGP IPv6 multicast address family view
network-admin
direct: Redistributes direct routes.
guard: Redistributes guard routes.
ospf: Redistributes OSPF routes.
ospfv3: Redistributes OSPFv3 routes.
rip: Redistributes RIP routes.
ripng: Redistributes RIPng routes.
static: Redistributes static routes.
process-id: Specifies a process by its ID in the range of 1 to 65535.
all-processes: Redistributes routes from all the processes of the specified IGP protocol.
allow-direct: Redistributes the networks of the local interfaces enabled with the specified routing protocol. By default, the networks of the local interfaces are not redistributed. If you specify both the allow-direct keyword and the route-policy route-policy-name option, make sure the if-match rule defined in the routing policy does not conflict with the allow-direct keyword. For example, if you specify the allow-direct keyword, do not configure the if-match route-type rule for the routing policy. Otherwise, the allow-direct keyword does not take effect.
med med-value: Specifies a MED value for redistributed routes, in the range of 0 to 4294967295. If you do not specify an MED, the metric of a redistributed route is used as its MED.
route-policy route-policy-name: Specifies a routing policy by its name, a case-sensitive string of 1 to 63 characters, to filter redistributed routes or set route attributes for redistributed routes.
The import-route command cannot redistribute default IGP routes. To redistribute default IGP routes, use the default-route imported command together with the import-route command.
Only active routes can be redistributed. You can use the display ip routing-table protocol or display ipv6 routing-table protocol command to view route state information.
If you do not specify any parameters when redistributing OSPF, OSPFv3, RIP, or RIPng routes, the command redistributes routes from process 1.
The ORIGIN attribute of routes redistributed by the import-route command is INCOMPLETE.
After you redistribute routes from all processes of a routing protocol by using the all-processes keyword, this command does not take effect on any processes of the protocol.
# In BGP IPv4 unicast address family view, redistribute routes from RIP process 1, and set the MED value for redistributed routes to 100.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] import-route rip 1 med 100
display ip routing-table protocol
display ipv6 routing-table protocol
import-route-append
import-route-append
Use import-route-append to redistribute routes from an IGP without overwriting the routes redistributed by the import-route command.
Use undo import-route-append to remove the redistributed routes.
Syntax
In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view/BGP IPv4 multicast address family view:
import-route-append { ospf | rip } [ { process-id | all-processes } [ allow-direct | med med-value | route-policy route-policy-name ] * ]
import-route-append { direct | static } [ med med-value | route-policy route-policy-name ] *
undo import-route-append { direct | { ospf | rip } [ process-id | all-processes ] | static }
In BGP IPv6 unicast address family view/BGP-VPN IPv6 unicast address family view/BGP IPv6 multicast address family view:
import-route-append { ospfv3 | ripng } [ { process-id | all-processes } [ allow-direct | med med-value | route-policy route-policy-name ] * ]
import-route-append { direct | static } [ med med-value | route-policy route-policy-name ] *
undo import-route-append { direct | { ospfv3 | ripng } [ process-id | all-processes ] | static }
Default
BGP does not redistribute IGP routes.
Views
BGP IPv4 unicast address family view
BGP-VPN IPv4 unicast address family view
BGP IPv6 unicast address family view
BGP-VPN IPv6 unicast address family view
BGP IPv4 multicast address family view
BGP IPv6 multicast address family view
Predefined user roles
network-admin
Parameters
direct: Redistributes direct routes.
ospf: Redistributes OSPF routes.
ospfv3: Redistributes OSPFv3 routes.
rip: Redistributes RIP routes.
ripng: Redistributes RIPng routes.
static: Redistributes static routes.
process-id: Specifies a process by its number in the range of 1 to 65535.
all-processes: Redistributes routes from all processes of the specified routing protocol.
allow-direct: Redistributes the networks of the local interfaces enabled with the specified routing protocol. By default, the networks of the local interfaces are not redistributed. If you specify both the allow-direct keyword and the route-policy route-policy-name option, make sure the if-match rule defined in the routing policy does not conflict with the allow-direct keyword. For example, if you specify the allow-direct keyword, do not configure the if-match route-type rule for the routing policy. Otherwise, the allow-direct keyword does not take effect.
med med-value: Specifies a MED value for redistributed routes, in the range of 0 to 4294967295. If you do not specify an MED, the metric of a redistributed route is used as its MED.
route-policy route-policy-name: Specifies a routing policy by its name, a case-sensitive string of 1 to 63 characters, to filter redistributed routes or set route attributes for redistributed routes.
Usage guidelines
If you execute the import-route-append command without executing the import-route command, the import-route-append command has the same effect as the import-route command.
If you execute both the import-route and import-route-append commands for an IGP process, the commands take effect as follows:
· A route is redistributed as long as it matches the criteria of either command.
· If a route matches the criteria of both commands, the route is redistributed, and the apply clauses in the routing policies specified in the two commands take effect as follows:
¡ If the apply clauses do not conflict, all apply clauses take effect.
¡ If conflicts occur between the apply clauses, only the apply clauses in the import-route-append command take effect.
· The MED value specified by the import-route-append command takes precedence over that specified by the import-route command.
If you execute the import-route-append command multiple times for an IGP process, the most recent configuration takes effect.
After you redistribute routes from all processes of a routing protocol by using the all-processes keyword, this command does not take effect on any processes of the protocol.
Examples
# In BGP IPv4 unicast address family view, redistribute routes matching routing policy policy1 from OSPF process 1 without overwriting the routes redistributed by the import-route command.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] import-route ospf 1
[Sysname-bgp-default-ipv4] import-route-append ospf 1 route-policy policy1
Related commands
display ip routing-table protocol
display ipv6 routing-table protocol
import-route
ip vpn-instance (BGP instance view)
Use ip vpn-instance to create a BGP-VPN instance and enter its view, or enter the view of an existing BGP-VPN instance.
Use undo ip vpn-instance to remove a BGP-VPN instance and all its configurations.
ip vpn-instance vpn-instance-name
undo ip vpn-instance vpn-instance-name
No BGP-VPN instances exist.
network-admin
vpn-instance-name: Specifies a VPN instance by its name, a case-sensitive string of 1 to 31 characters.
After you create a BGP peer in BGP-VPN instance view, the BGP routes learned from the peer are added into the routing table of the specified VPN instance.
After entering BGP-VPN instance view, you can execute related commands to add routes learned from different sites into different VPN instances.
Before you execute this command, you must perform the following tasks:
· Use the ip vpn-instance command to create the VPN instance in system view.
· Use the route-distinguisher command to configure a route distinguisher (RD) for the VPN instance.
# Create a BGP-VPN instance and enter its view.
<Sysname> system-view
[Sysname] ip vpn-instance vpn1
[Sysname-vpn-instance-vpn1] route-distinguisher 100:1
[Sysname-vpn-instance-vpn1] quit
[Sysname] bgp 100
[Sysname-bgp-default] ip vpn-instance vpn1
[Sysname-bgp-default-vpn1]
ip vpn-instance (system view)(VPN Instance Command Reference)
route-distinguisher(VPN Instance Command Reference)
label-allocation-mode
Use label-allocation-mode to specify a label allocation mode.
Use undo label-allocation-mode to restore the default.
label-allocation-mode { per-prefix | per-vrf }
undo label-allocation-mode
BGP allocates labels on a per-next-hop basis.
network-admin
per-prefix: Allocates a label to each route prefix.
per-vrf: Allocates a label to each VPN instance.
Usage guidelines
CAUTION: A change to the label allocation mode enables BGP to re-advertise all routes, which will cause temporary service interruption. Use this command with caution. |
BGP supports the following label allocation modes:
· Per-prefix—Allocates a label to each route prefix.
· Per-next-hop—Allocates a label to each next hop. This mode is applicable when the number of labels required by the per-prefix mode exceeds the maximum number of labels supported by the device.
· Per-VPN-instance—Allocates a label to each VPN instance. This mode is applicable when the number of labels required by the per-next-hop mode exceeds the maximum number of labels supported by the device.
When you specify the per-prefix or per-next-hop label allocation mode, you can execute the vpn popgo command to specify the POPGO forwarding mode on an egress PE. The egress PE will pop the label for each packet and forward the packet out of the interface corresponding to the label.
When you specify the per-VPN instance label allocation mode, do not execute the vpn popgo command because it is mutually exclusive with the label-allocation-mode per-vrf command. The egress PE will pop the label for each packet and forward the packet through the FIB table.
# Specify the per-prefix label allocation mode.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] label-allocation-mode per-prefix
Related commands
log-peer-change
Use log-peer-change to enable logging for BGP session state changes globally.
Use undo log-peer-change to disable logging for BGP session state changes globally.
log-peer-change
undo log-peer-change
Logging for BGP session state changes is enabled globally.
network-admin
After you execute both the log-peer-change and peer log-change commands, BGP logs session establishment and disconnection events for the peer or peer group. To display the log information, use the display bgp peer ipv4 unicast log-info command or the display bgp peer ipv6 unicast log-info command. The logs are sent to the information center of the device. The output rules of the logs (whether to output the logs and where to output) are determined by the information center configuration. For more information about information center configuration, see Network Management and Monitoring Configuration Guide.
If you disable logging for BGP session state changes globally or disable logging for a peer or peer group, BGP does not generate logs for session establishments and disconnections.
# Enable logging for session state changes globally.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] log-peer-change
display bgp peer
network
Use network to inject a network to the BGP routing table and configure BGP to advertise the network.
Use undo network to remove a local network.
In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view/BGP IPv4 multicast address family view:
network ipv4-address [ mask-length | mask ] [ route-policy route-policy-name ]
undo network ipv4-address [ mask-length | mask ]
In BGP IPv6 unicast address family view/BGP-VPN IPv6 unicast address family view/BGP IPv6 multicast address family view:
network ipv6-address prefix-length [ route-policy route-policy-name ]
undo network ipv6-address prefix-length
BGP does not advertise local networks.
BGP IPv4 unicast address family view
BGP-VPN IPv4 unicast address family view
BGP IPv6 unicast address family view
BGP-VPN IPv6 unicast address family view
BGP IPv4 multicast address family view
BGP IPv6 multicast address family view
network-admin
ipv4-address: Specifies an IPv4 network address. If you do not specify the mask or mask-length argument, natural mask is used.
mask-length: Specifies a mask length in the range of 0 to 32.
mask: Specifies a mask in dotted decimal notation.
ipv6-address: Specifies an IPv6 network address.
prefix-length: Specifies a prefix length in the range of 0 to 128.
route-policy route-policy-name: Specifies a routing policy by its name, a case-sensitive string of 1 to 63 characters, to filter routes or set the route attributes.
The network to be injected must be available and active in the local IP routing table.
The ORIGIN attribute of the route injected with the network command is IGP.
When you execute the undo network command, you must specify the same mask or mask length/prefix length that you specified for the network command. Otherwise, the configuration cannot be removed.
# In BGP IPv4 unicast address family view, inject local network 10.0.0.0/16 to the BGP routing table.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] network 10.0.0.0 255.255.0.0
network short-cut
Use network short-cut to increase the preference for a received EBGP route. This EBGP route is called a shortcut route.
Use undo network short-cut to remove the configuration.
In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view/BGP IPv4 multicast address family view:
network ipv4-address [ mask-length | mask ] short-cut
undo network ipv4-address [ mask-length | mask ] short-cut
In BGP IPv6 unicast address family view/BGP-VPN IPv6 unicast address family view/BGP IPv6 multicast address family view:
network ipv6-address prefix-length short-cut
undo network ipv6-address prefix-length short-cut
A received EBGP route has a preference of 255.
BGP IPv4 unicast address family view
BGP-VPN IPv4 unicast address family view
BGP IPv6 unicast address family view
BGP-VPN IPv6 unicast address family view
BGP IPv4 multicast address family view
BGP IPv6 multicast address family view
network-admin
ipv4-address: Specifies an IPv4 network address. If you do not specify the mask or mask-length argument, natural mask is used.
mask-length: Specifies a mask length in the range of 0 to 32.
mask: Specifies a mask for the network address, in dotted decimal notation.
ipv6-address: Specifies an IPv6 network address.
prefix-length: Specifies a prefix length in the range of 0 to 128.
Different routing protocols might find different routes to the same destination. However, not all of those routes are optimal. For route selection, routing protocols, direct routes, and static routes are assigned different preferences. The route with the highest preference is preferred.
By default, the preference of an EBGP route is lower than a local route. If a device has an EBGP route and a local route to reach the same destination, the device does not select the EBGP route. You can use the network shortcut command to configure the EBGP route to have the same preference as the local route so the EBGP route is more likely to become the optimal route.
You can use the preference command to modify the preferences for external and local BGP routes.
# In BGP IPv4 unicast address family view, increase the preference of EBGP route 10.0.0.0/16.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] network 10.0.0.0 255.255.0.0 short-cut
preference
non-stop-routing
Use non-stop-routing to enable BGP nonstop routing (NSR).
Use undo non-stop-routing to disable BGP NSR.
non-stop-routing
undo non-stop-routing
The following compatibility matrix shows the support of hardware platforms for this command:
Hardware |
Command compatibility |
CSAP-NTA-100, CSAP-NTA-200, CSAP-NTA-AK375 |
Yes |
CSAP-NTA-300, CSAP-NTA-400, CSAP-NTA-500, CSAP-NTA-600 |
Yes |
CSAP-NTA-V200, CSAP-NTA-V1000 |
No |
BGP NSR is disabled.
network-admin
BGP NSR ensures continuous routing by synchronizing BGP state and data information from the active BGP process to the standby BGP process. The standby BGP process can seamlessly take over all services when the active process fails.
# Enable BGP NSR.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] non-stop-routing
display bgp non-stop-routing status
peer advertise-community
Use peer advertise-community to advertise the COMMUNITY attribute to a peer or peer group.
Use undo peer advertise-community to disable the COMMUNITY attribute advertisement to a peer or peer group.
In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view/BGP VPNv4 address family view/BGP VPNv6 address family view/BGP IPv4 multicast address family view/BGP MVPN address family view:
peer { group-name | ipv4-address [ mask-length ] } advertise-community
undo peer { group-name | ipv4-address [ mask-length ] } advertise-community
In BGP IPv6 unicast address family view:
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } advertise-community
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } advertise-community
In BGP IPv6 multicast address family view/BGP-VPN IPv6 unicast address family view:
peer { group-name | ipv6-address [ prefix-length ] } advertise-community
undo peer { group-name | ipv6-address [ prefix-length ] } advertise-community
No COMMUNITY attribute is advertised to any peers or peer groups.
BGP IPv4 unicast address family view
BGP-VPN IPv4 unicast address family view
BGP VPNv4 address family view
BGP IPv6 unicast address family view
BGP-VPN IPv6 unicast address family view
BGP VPNv6 address family view
BGP IPv4 multicast address family view
BGP IPv6 multicast address family view
BGP MVPN 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 advertises the COMMUNITY attribute 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 advertises the COMMUNITY attribute to all dynamic peers in the subnet.
The COMMUNITY attribute is a group of specific data carried in update messages. A route can carry one or more COMMUNITY attribute values (each is represented by a 4-byte integer). The receiving router processes the route (for example, determining whether to advertise the route and the scope for advertising the route) based on the COMMUNITY attribute values.
After you execute the peer advertise-community command, routing updates advertised to the peer carry the COMMUNITY attribute.
After you execute the undo peer advertise-community command, BGP, upon receiving a route with the COMMUNITY attribute, removes the COMMUNITY attribute before sending the route to the peer or peer group.
# In BGP IPv4 unicast address family view, advertise the COMMUNITY attribute to peer group test.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] peer test advertise-community
apply community
if-match community
ip community-list
peer advertise-ext-community
Use peer advertise-ext-community to advertise the extended community attribute to a peer or peer group.
Use undo peer advertise-ext-community to disable the extended community attribute advertisement to a peer or peer group.
In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view/BGP IPv4 multicast address family view:
peer { group-name | ipv4-address [ mask-length ] } advertise-ext-community
undo peer { group-name | ipv4-address [ mask-length ] } advertise-ext-community
In BGP IPv6 unicast address family view:
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } advertise-ext-community
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } advertise-ext-community
In BGP IPv6 multicast address family view:
peer { group-name | ipv6-address [ prefix-length ] } advertise-ext-community
undo peer { group-name | ipv6-address [ prefix-length ] } advertise-ext-community
No extended community attribute is advertised to any peers or peer groups.
BGP IPv4 unicast address family view
BGP-VPN IPv4 unicast address family view
BGP IPv6 unicast address family view
BGP IPv4 multicast address family view
BGP IPv6 multicast 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 advertises the extended community attribute 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 advertises the extended community attribute to all dynamic peers in the subnet.
To meet increasing user demands, BGP defines a new attribute—extended community attribute. The extended community attribute has the following advantages over the COMMUNITY attribute:
· The extended community attribute has an 8-byte length.
· The extended community attribute supports various types. You can select an extended community attribute type as needed to implement route filtering and control. This simplifies configuration and management.
After you execute the peer advertise-ext-community command, route updates sent to the peer or peer group carry the extended community attribute.
After you execute the undo peer advertise-ext-community command, BGP, upon receiving a route with the extended community attribute, removes the extended community attribute before sending the route to the peer or peer group.
# In BGP IPv4 unicast address family view, advertise the extended community attribute to peer group test.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] peer test advertise-ext-community
apply extcommunity
if-match extcommunity
ip extcommunity-list
peer advertise-policy exist-policy
Use peer advertise-policy exist-policy to specify an existent policy to control route advertisement.
Use undo peer advertise-policy exist-policy to remove the configuration.
Syntax
In BGP IPv4 unicast address family view:
peer { group-name | ipv4-address [ mask-length ] } advertise-policy advertise-policy-name exist-policy exist-policy-name
undo peer { group-name | ipv4-address [ mask-length ] } advertise-policy exist-policy
In BGP IPv6 unicast address family view:
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } advertise-policy advertise-policy-name exist-policy exist-policy-name
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } advertise-policy exist-policy
Default
No existent policy is specified to control route advertisement.
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.
advertise-policy-name: Specifies a routing policy by its name, a case-sensitive string of 1 to 63 characters. The routing policy is used as the route advertisement policy.
exist-policy exist-policy-name: Specifies a routing policy by its name, a case-sensitive string of 1 to 63 characters. The routing policy is used as the existent policy.
Usage guidelines
After you configure this command, routes that match the route advertisement policy can be advertised only when the BGP routing table contains prefixes that match the existent policy.
The existent policy does not apply to routes that do not match the route advertisement policy.
Examples
# In BGP IPv4 unicast address family view, configure BGP to advertise routes matching routing policy adv-policy to peer 1.1.1.1 only when the BGP routing table contains prefixes matching routing policy ex-policy.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] peer 1.1.1.1 advertise-policy adv-policy exist-policy ex-policy
Related commands
filter-policy export
filter-policy import
peer as-path-acl
peer filter-policy
peer prefix-list
peer route-policy
peer advertise-policy non-exist-policy
route-policy
peer advertise-policy non-exist-policy
Use peer advertise-policy non-exist-policy to specify a nonexistent policy to control route advertisement.
Use undo peer advertise-policy non-exist-policy to remove the configuration.
Syntax
In BGP IPv4 unicast address family view:
peer { group-name | ipv4-address [ mask-length ] } advertise-policy advertise-policy-name non-exist-policy non-exist-policy-name
undo peer { group-name | ipv4-address [ mask-length ] } advertise-policy non-exist-policy
In BGP IPv6 unicast address family view:
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } advertise-policy advertise-policy-name non-exist-policy non-exist-policy-name
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } advertise-policy non-exist-policy
Default
No nonexistent policy is specified to control route advertisement.
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.
advertise-policy-name: Specifies a routing policy by its name, a case-sensitive string of 1 to 63 characters. The routing policy is used as the route advertisement policy.
non-exist-policy non-exist-policy-name: Specifies a routing policy by its name, a case-sensitive string of 1 to 63 characters. The routing policy is used as the nonexistent policy.
Usage guidelines
After you configure this command, routes that match the route advertisement policy can be advertised only when the BGP routing table does not contain any prefixes that match the nonexistent policy.
The nonexistent policy does not apply to routes that do not match the route advertisement policy.
Examples
# In BGP IPv4 unicast address family view, configure BGP to advertise routes matching routing policy adv-policy to peer 1.1.1.1 only when the BGP routing table does not contain any prefixes matching routing policy n-ex-policy.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] peer 1.1.1.1 advertise-policy adv-policy non-exist-policy n-ex-policy
Related commands
filter-policy export
filter-policy import
peer as-path-acl
peer filter-policy
peer prefix-list
peer route-policy
peer advertise-policy exist-policy
route-policy
peer allow-as-loop
Use peer allow-as-loop to allow a local AS number to exist in the AS_PATH attribute of routes from a peer or peer group, and to set the number of times the local AS number can appear.
Use undo peer allow-as-loop to remove the configuration.
In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view/BGP VPNv4 address family view/BGP IPv4 multicast address family view:
peer { group-name | ipv4-address [ mask-length ] } allow-as-loop [ number ]
undo peer { group-name | ipv4-address [ mask-length ] } allow-as-loop
In BGP IPv6 unicast address family view:
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } allow-as-loop [ number ]
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } allow-as-loop
In BGP-VPN IPv6 unicast address family view/BGP IPv6 multicast address family view:
peer { group-name | ipv6-address [ prefix-length ] } allow-as-loop [ number ]
undo peer { group-name | ipv6-address [ prefix-length ] } allow-as-loop
The local AS number is not allowed to exist in the AS_PATH attribute of routes from a peer or peer group.
BGP IPv4 unicast address family view
BGP-VPN IPv4 unicast address family view
BGP VPNv4 address family view
BGP IPv6 unicast address family view
BGP-VPN IPv6 unicast address family view
BGP IPv4 multicast address family view
BGP IPv6 multicast 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 in this command, BGP allows a local AS number to exist in the AS_PATH attribute of routes from 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 in this command, BGP allows a local AS number to exist in the AS_PATH attribute of routes from all dynamic peers in the subnet.
number: Specifies the number of times for which the local AS number can appear, in the range of 1 to 10. The default number is 1. If the number of times for which the local AS number appears in a route is more than the specified number, BGP considers that a routing loop occurs and discards the route.
By default, BGP does not receive routes that contain the local AS number in the AS_PATH attribute to avoid routing loops. However, in some network environments, the AS_PATH attribute of a route from a peer must be allowed to contain the local AS number. Otherwise, the route cannot be advertised correctly.
# In BGP IPv4 unicast address family view, set the number of times the local AS number can appear in AS_PATH attribute of routes from peer group test to 2.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] peer test allow-as-loop 2
peer as-number (for a BGP peer group)
Use peer as-number to specify an AS number for a peer group.
Use undo peer as-number to delete the AS number of a peer group.
peer group-name as-number as-number
undo peer group-name as-number
No AS number is specified for a peer group.
BGP-VPN instance view
network-admin
group-name: Specifies a name for a peer group, a case-sensitive string of 1 to 47 characters. The peer group must have been created.
as-number: Specifies an AS number for a peer group, in the range of 1 to 4294967295.
This command applies only to a peer group with no peers in it.
When you specify an AS number for a peer group and want to add peers to it, make sure the AS number of the peers is the same as the peer group.
If you do not specify an AS number for a peer group, peers added to it can use their own AS numbers.
# In BGP instance view, set the AS number for peer group test to 100.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] peer test as-number 100
peer as-number (for a BGP peer)
Use peer as-number to create a BGP peer and specify its AS number.
Use undo peer to delete a BGP peer.
peer { ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } as-number as-number
undo peer { ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] }
No BGP peers exist.
BGP-VPN instance view
network-admin
ipv4-address: Specifies the IPv4 address of a peer.
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 to establish dynamic peer relationships with all devices in the subnet.
ipv6-address: Specifies the IPv6 address of a peer.
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 establish dynamic peer relationships with all devices in the subnet.
as-number: Specifies an AS number for the peer, in the range of 1 to 4294967295. If the AS numbers of the peer and the local router are the same, the peer is an IBGP peer. If they are different, the peer is an EBGP peer.
You can also create a peer and add it to a peer group by using the peer group command.
To modify the AS number of a peer, do not execute the peer as-number command repeatedly. Instead, you must first delete the peer and configure it again.
After you create a peer, you must use the peer enable command to enable BGP to exchange routing information with the specified peer.
For a remote device to establish a peer relationship with the local device, you must specify the IP address of the local device on the remote device.
# In BGP instance view, create BGP peer 1.1.1.1 and set its AS number to 100.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] peer 1.1.1.1 as-number 100
display bgp peer
peer enable
peer group
peer as-path-acl
Use peer as-path-acl to specify an AS path list to filter routes incoming from or outgoing to a peer or peer group.
Use undo peer as-path-acl to delete the AS path list specified to filter routes incoming from or outgoing to a peer or peer group.
In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view/BGP VPNv4 address family view/BGP IPv4 multicast address family view:
peer { group-name | ipv4-address [ mask-length ] } as-path-acl as-path-acl-number { export | import }
undo peer { group-name | ipv4-address [ mask-length ] } as-path-acl { export | import }
In BGP IPv6 unicast address family view:
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } as-path-acl as-path-acl-number { export | import }
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } as-path-acl { export | import }
In BGP IPv6 multicast address family view:
peer { group-name | ipv6-address [ prefix-length ] } as-path-acl as-path-acl-number { export | import }
undo peer { group-name | ipv6-address [ prefix-length ] } as-path-acl { export | import }
No AS path list is specified for filtering.
BGP IPv4 unicast address family view
BGP-VPN IPv4 unicast address family view
BGP VPNv4 address family view
BGP IPv6 unicast address family view
BGP IPv4 multicast address family view
BGP IPv6 multicast 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 specifies an AS path list to filter routes incoming from or outgoing 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 an AS path list to filter routes incoming from or outgoing to all dynamic peers in the subnet.
as-path-acl-number: Specifies an AS path list by its number in the range of 1 to 256.
export: Filters outgoing routes.
import: Filters incoming routes.
The specified AS path list must have been created with the ip as-path command in system view. If you specify a nonexistent AS path list, all routes can pass the AS path list.
# In BGP IPv4 unicast address family view, specify AS path list 1 to filter routes outgoing to peer group test.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] peer test as-path-acl 1 export
filter-policy export
filter-policy import
ip as-path
peer filter-policy
peer prefix-list
peer route-policy
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 [ 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.
BGP-VPN instance 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 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.
multi-hop: Enables multi-hop BFD.
single-hop: Enables single-hop BFD.
When you do not specify the multi-hop keyword or the single-hop keyword:
· If an IBGP peer or peer group is specified, this command enables multi-hop BFD 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 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 for the EBGP peer or peer group.
For more information about multi-hop and single-hop BFD, see Network Management and Monitoring 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.
To establish a 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.
# In BGP instance view, enable BFD for the link to BGP peer group test.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] peer test bfd
display bfd session (Network Management and Monitoring Command Reference)
display bgp peer
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.
BGP-VPN instance 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 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 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.
BGP-VPN instance 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 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.
BGP-VPN instance 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 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 connect-interface
Use peer connect-interface to specify a source interface (IPv4 address/IPv6 address) for establishing TCP connections to a peer or peer group.
Use undo peer connect-interface to remove the configuration.
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } connect-interface interface-type interface-number
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } connect-interface
BGP uses the primary IPv4 or IPv6 address of the output interface in the optimal route destined for the BGP peer or peer group as the source address.
BGP-VPN instance 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 specifies a source interface for establishing TCP connections to all dynamic peers in the network.
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 source interface for establishing TCP connections to all dynamic peers in the subnet.
interface-type interface-number: Specifies an interface by its type and number.
The peer connect-interface command and the peer source-address command can both change the source address for establishing TCP connections. If you execute both commands, the most recent configuration takes effect.
The peer source-address and peer connect-interface commands are applicable to the following scenarios:
· The peer's IPv4/IPv6 address does not belong to the interface directly connected to the local router. To ensure successful TCP connection establishment, use one of the following methods:
¡ Specify the interface to which the IPv4/IPv6 address belongs as the source interface on the peer.
¡ Specify the IPv4/IPv6 address of the interface directly connected to the local router as the source address on the peer.
· A BGP peer at an IPv6 link-local address must be directly connected to the local router. On the local router, you must use the peer connect-interface command to specify the interface directly connected to the BGP peer as the source interface of TCP connections.
· On a BGP router that has multiple links to a peer, the source interface for TCP connection changes because the primary source interface fails. To avoid this problem, specify a loopback interface as the source interface or specify the IP address of a loopback interface as the source address.
· You want to establish multiple BGP sessions to a router. In this case, BGP might fail to determine the source address for each TCP connection based on the optimal route to the peer. To prevent this problem, use one of the following methods:
¡ If the BGP sessions use IP addresses of different interfaces, specify a source interface or source address for each session.
¡ If the BGP sessions use different IP addresses of the same interface, specify a source address for each session.
The source interfaces on the local router and the peer must be reachable to each other.
To specify an indirectly connected interface on an EBGP peer as the source interface, use the peer ebgp-max-hop command. The command allows the establishment of an EBGP session to the indirectly connected peer.
If an interface has multiple IPv4 addresses, BGP uses the primary IPv4 address to establish TCP connections. If an interface has multiple IPv6 addresses, BGP selects a source IPv6 address. To use an IPv6 address as the source address, specify that IPv6 address by using the peer source-address command.
You cannot specify a virtual template (VT) interface as the source interface for establishing TCP connections because a VT interface cannot process services.
# In BGP instance view, specify loopback 0 as the source interface for TCP connections to peer group test.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] peer test connect-interface loopback 0
peer ebgp-max-hop
peer source-address
peer default-route-advertise
Use peer default-route-advertise to advertise a default route to a peer or peer group.
Use undo peer default-route-advertise to disable default route advertisement to a peer or peer group.
In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view/BGP IPv4 multicast address family view:
peer { group-name | ipv4-address [ mask-length ] } default-route-advertise [ route-policy route-policy-name ]
undo peer { group-name | ipv4-address [ mask-length ] } default-route-advertise
In BGP VPNv4 address family view:
peer { group-name | ipv4-address [ mask-length ] } default-route-advertise vpn-instance vpn-instance-name
undo peer { group-name | ipv4-address } default-route-advertise vpn-instance vpn-instance-name
In BGP IPv6 unicast address family view:
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } default-route-advertise [ route-policy route-policy-name ]
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } default-route-advertise
In BGP-VPN IPv6 unicast address family view/BGP IPv6 multicast address family view:
peer { group-name | ipv6-address [ prefix-length ] } default-route-advertise [ route-policy route-policy-name ]
undo peer { group-name | ipv6-address [ prefix-length ] } default-route-advertise
In BGP IPv4 RT filter address family view:
peer { group-name | ipv4-address [ mask-length ] } default-route-advertise [ route-policy route-policy-name ]
undo peer { group-name | ipv4-address [ mask-length ] } default-route-advertise
No default route is advertised to any peers or peer groups.
BGP IPv4 unicast address family view
BGP-VPN IPv4 unicast address family view
BGP VPNv4 address family view
BGP IPv6 unicast address family view
BGP-VPN IPv6 unicast address family view
BGP IPv4 multicast address family view
BGP IPv6 multicast address family view
BGP IPv4 RT filter 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 advertises a default route 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 advertises a default route to all dynamic peers in the subnet.
route-policy route-policy-name: Specifies a routing policy by its name, a case-sensitive string of 1 to 63 characters, to modify the route attribute.
vpn-instance vpn-instance-name: Specifies an MPLS L3VPN instance by its name, a case-sensitive string of 1 to 31 characters.
This command enables the router to send a default route with the next hop being itself to the peer or peer group regardless of whether the default route exists in the routing table.
# In BGP IPv4 unicast address family view, advertise a default route to peer group test.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] peer test default-route-advertise
peer description
Use peer description to configure a description for a peer or peer group.
Use undo peer description to remove the description for a peer or peer group.
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } description text
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } description
No description information is configured for a peer or peer group.
BGP-VPN instance 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 a description 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 a description for all dynamic peers in the subnet.
text: Specifies a description for a peer or peer group, a case-sensitive string of 1 to 79 characters.
# In BGP instance view, set the description for peer group test to ISP1.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] peer test description ISP1
peer ebgp-max-hop
Use peer ebgp-max-hop to enable BGP to establish an EBGP session to an indirectly connected peer or peer group and specify the maximum hop count.
Use undo peer ebgp-max-hop to disable BGP from establishing an EBGP session to an indirectly connected peer or peer group.
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } ebgp-max-hop [ hop-count ]
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } ebgp-max-hop
BGP does not establish an EBGP session to an indirectly connected peer or peer group.
BGP-VPN instance 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 in this command, BGP establishes EBGP sessions to all indirectly connected 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 in this command, BGP establishes EBGP sessions to all indirectly connected dynamic peers in the subnet.
hop-count: Specifies the maximum number of hop counts, in the range of 1 to 255. The default is 64.
To become EBGP peers, two routers must be directly connected and use directly connected interfaces to establish an EBGP session. If they are not directly connected, use the peer ebgp-max-hop command to establish an EBGP session over multiple hops between two peers.
This command takes effect only on routes received after you execute this command. To apply this command to existing routes, use the refresh bgp command to soft-reset BGP sessions.
When the BGP GTSM feature is enabled, two peers can establish an EBGP session after passing GTSM check, regardless of whether the maximum number of hops is reached.
# In BGP instance view, enable BGP to establish EBGP sessions to indirectly connected EBGP peer group test, and set the maximum hop count to 64 (default).
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] peer test ebgp-max-hop
peer ttl-security
peer enable
Use peer enable to enable BGP to exchange routing information for an address family with a peer or peer group.
Use undo peer enable to disable BGP from exchanging routing information for an address family with a peer or peer group.
In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view/BGP VPNv4 address family view/BGP-VPN VPNv4 address family view/BGP VPNv6 address family view/BGP IPv4 multicast address family view/BGP IPv4 MDT address family view/BGP IPv4 RT filter address family view/BGP MVPN address family view:
peer { group-name | ipv4-address [ mask-length ] } enable
undo peer { group-name | ipv4-address [ mask-length ] } enable
In BGP IPv6 unicast address family view:
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } enable
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } enable
In BGP LS address family view:
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } enable
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } enable
In BGP-VPN IPv6 unicast address family view/BGP IPv6 multicast address family view:
peer { group-name | ipv6-address [ prefix-length ] } enable
undo peer { group-name | ipv6-address [ prefix-length ] } enable
BGP cannot exchange routing information with a peer or peer group.
BGP IPv4 unicast address family view
BGP-VPN IPv4 unicast address family view
BGP VPNv4 address family view
BGP-VPN VPNv4 address family view
BGP IPv6 unicast address family view
BGP LS address family view
BGP-VPN IPv6 unicast address family view
BGP VPNv6 address family view
BGP IPv4 multicast address family view
BGP IPv6 multicast address family view
BGP IPv4 MDT address family view
BGP IPv4 RT filter address family view
BGP MVPN 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 in this command, BGP exchanges routing information for an address family 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 in this command, BGP exchanges routing information for an address family with all dynamic peers in the subnet.
Executing the peer enable command in different views enables BGP to exchange routing information for the corresponding address families with the specified peer.
· In BGP IPv4 unicast address family view, the command enables the capability to exchange IPv4 unicast routing information. It also adds the learned routes to the BGP routing table of the public network.
· In BGP-VPN IPv4 unicast address family view, the command enables the capability to exchange IPv4 unicast routing information. It also adds the learned routes to the BGP routing table of the specified VPN instance.
· In BGP VPNv4 address family view, the command enables the capability to exchange VPNv4 routing information.
· In BGP-VPN VPNv4 address family view, the command enables the capability to exchange VPNv4 routing information. In a nested VPN network, execute this command on ISP PE devices in BGP-VPN VPNv4 address family view to do the following:
¡ Enable the PE devices to exchange BGP VPNv4 routing information with ISP CEs.
¡ Add the VPNv4 routes learned by the PE devices to the routing table of the specified VPN instance.
· In BGP IPv6 unicast address family view, the command enables the capability to exchange IPv6 unicast routing information. It also adds the learned routes to the IPv6 BGP routing table of the public network.
· In BGP-VPN IPv6 unicast address family view, the command enables the capability to exchange IPv6 unicast routing information. It also adds the learned routes to the IPv6 BGP routing table of the specified VPN instance.
· In BGP VPNv6 address family view, the command enables the capability to exchange VPNv6 routing information.
· In BGP IPv4 multicast address family view, the command enables the capability to exchange IPv4 unicast routes used for RPF check. For information about RPF check, see IP Multicast Configuration Guide.
· In BGP IPv6 multicast address family view, the command enables the capability to exchange IPv6 unicast routes used for RPF check. For information about RPF check, see IP Multicast Configuration Guide.
· In BGP IPv4 MDT address family view, the command enables the capability to exchange MDT information.
· In BGP IPv4 RT filter address family view, the command enables the capability to exchange IPv4 RT filter routing information.
The undo peer enable command disables BGP to exchange routing information for the corresponding address family with the peer.
# In BGP IPv4 unicast address family view, enable BGP to exchange IPv4 unicast routing information with 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 enable
display bgp peer
peer fake-as
Use peer fake-as to advertise a fake AS number to a peer or peer group.
Use undo peer fake-as to remove the fake AS number advertised to a peer or peer group.
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } fake-as as-number
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } fake-as
No fake local AS number is advertised to a peer or peer group.
BGP-VPN instance 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 advertises a fake AS number 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 advertises a fake AS number to all dynamic peers in the subnet.
as-number: Specifies a fake AS number in the range of 1 to 4294967295.
After you move a BGP router from an AS to another AS (from AS 2 to AS 3 for example), you have to modify the AS number of the router on all its EBGP peers. To avoid such modifications, you can configure the router to advertise a fake AS number 2 to its EBGP peers so that the EBGP peers still think that Router A is in AS 2.
The peer fake-as command is applicable only to EBGP peers or peer groups.
If you execute the peer fake-as command on the local router, specify the local router's AS number on the peer as the fake local AS number specified in the command.
# In BGP instance view, advertise a fake AS number of 200 to peer group test.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] peer test fake-as 200
peer filter-policy
Use peer filter-policy to filter routes advertised to or received from a peer or peer group by using an ACL.
Use undo peer filter-policy to remove the ACL specified to filter routes advertised to or received from a peer or peer group.
In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view/BGP VPNv4 address family view/BGP IPv4 multicast address family view:
peer { group-name | ipv4-address [ mask-length ] } filter-policy ipv4-acl-number { export | import }
undo peer { group-name | ipv4-address [ mask-length ] } filter-policy { export | import }
In BGP IPv6 unicast address family view:
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } filter-policy ipv6-acl-number { export | import }
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } filter-policy { export | import }
In BGP-VPN IPv6 unicast address family view/BGP IPv6 multicast address family view:
peer { group-name | ipv6-address [ prefix-length ] } filter-policy ipv6-acl-number { export | import }
undo peer { group-name | ipv6-address [ prefix-length ] } filter-policy { export | import }
In BGP VPNv6 address family view:
peer { group-name | ipv4-address [ mask-length ] } filter-policy ipv6-acl-number { export | import }
undo peer { group-name | ipv4-address [ mask-length ] } filter-policy { export | import }
No ACL-based filtering is configured.
BGP IPv4 unicast address family view
BGP-VPN IPv4 unicast address family view
BGP VPNv4 address family view
BGP IPv6 unicast address family view
BGP-VPN IPv6 unicast address family view
BGP VPNv6 address family view
BGP IPv4 multicast address family view
BGP IPv6 multicast 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 filters routes advertised to or received from all dynamic peers in the subnet by using an ACL.
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 filters routes advertised to or received from all dynamic peers in the subnet by using an ACL.
ipv4-acl-number: Specifies an ACL by its number in the range of 2000 to 3999.
ipv6-acl-number: Specifies an IPv6 ACL by its number in the range of 2000 to 3999.
export: Filters routes advertised to the peer/peer group.
import: Filters routes received from the peer/peer group.
The specified ACL used by the peer filter-policy command must have been created with the acl command in system view. Otherwise, all routes can pass the ACL.
If you use a basic ACL (with a number from 2000 to 2999) configured with the rule [ rule-id ] { deny | permit } source source-address source-wildcard command, the command matches routes whose destination network addresses match the source-address source-wildcard argument without matching the masks of the destination addresses.
To use an advanced ACL (with a number from 3000 to 3999) in the command, configure the ACL using one of the following steps:
· To deny/permit a route with the specified destination, use the rule [ rule-id ] { deny | permit } ip source sour-addr sour-wildcard command.
· To deny/permit a route with the specified destination and mask, use the rule [ rule-id ] { deny | permit } ip source sour-addr sour-wildcard destination dest-addr dest-wildcard command.
The source keyword specifies the destination address of a route and the destination keyword specifies the subnet mask of the destination address. For the mask configuration to take effect, specify a contiguous subnet mask.
# In BGP IPv4 unicast address family view, apply ACL 2000 to filter routes advertised to peer group test.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] peer test filter-policy 2000 export
acl (ACL and QoS Command Reference)
filter-policy export
filter-policy import
peer as-path-acl
peer prefix-list
peer route-policy
peer group
Use peer group to add a peer to a peer group.
Use undo peer group to delete a peer from a peer group.
peer { ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } group group-name [ as-number as-number ]
undo peer { ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } group group-name
No peers exist in a peer group.
BGP-VPN instance view
network-admin
ipv4-address: Specifies a peer by its IPv4 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 adds all dynamic peers in the subnet to a peer group.
ipv6-address: Specifies a peer 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 adds all dynamic peers in the subnet to a peer group.
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.
as-number as-number: Specifies an AS for a peer by its number in the range of 1 to 4294967295.
You can add a peer to a peer group in the following ways:
· Use the peer as-number command to create a peer and specify its AS number, and then use the peer group command to add the peer to the peer group.
¡ You can specify the as-number keyword for the peer group command. The AS number must be the same as the AS number specified in the peer as-number command.
¡ If you have specified the AS number of the peer group with the peer as-number command, the peer to be added must have the same AS number as the peer group.
¡ To add a peer to an IBGP peer group, the peer must be an IBGP peer.
· Use the peer group command to create a peer and add it to the peer group.
¡ If you have specified the AS number of the peer group with the peer as-number command, you do not need to specify the as-number keyword when you execute the peer group command. This is because the AS number of the peer is the same as the peer group. To specify the as-number keyword for the peer group command, make sure the AS number is the same as the peer group.
¡ If no AS number is specified for an EBGP peer group, specify the as-number keyword when you execute the peer group command.
¡ If no AS number is specified for an IBGP peer group, you do not need to specify the as-number keyword when you execute the peer group command. This is because the AS number of the IBGP peer group is the local AS number. To specify the as-number keyword for the peer group command, make sure the AS number is the same as the local AS number.
If you have specified the AS number of a peer group with the peer as-number command, only the peers with the same AS number can be added to the peer group. All peers in the group share the same AS number. If you have not specified the AS number for a peer group, peers added to it can use their own AS numbers.
After you add a peer to a peer group, you must use the peer enable command to enable BGP to exchange routing information with the peer group.
# In BGP instance view, add peer 10.1.1.1 to EBGP peer group test.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] group test external
[Sysname-bgp-default] peer 10.1.1.1 group test as-number 2004
group
peer as-number
peer enable
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
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } ignore
BGP can establish a session to a peer or peer group.
BGP-VPN instance 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 in this command, BGP tears down sessions 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 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.
# 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
peer ignore-first-as
Use peer ignore-first-as to enable BGP to ignore the first AS number of EBGP route updates received from a peer or peer group.
Use undo peer ignore-first-as to remove the configuration.
Syntax
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } ignore-first-as
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } ignore-first-as
Default
BGP checks the first AS number of an EBGP-learned route update. If the first AS number is neither that of the BGP peer nor a private AS number, the BGP router disconnects the BGP session to the peer.
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 in this command, BGP ignores the first AS number of EBGP route updates received from 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 in this command, BGP ignores the first AS number of EBGP route updates received from all dynamic peers in the subnet.
Usage guidelines
This command takes effect only on the EBGP routes received after you execute this command. If you execute the peer ignore-first-as and then the undo peer ignore-first-as commands, BGP advertises a ROUTE-REFRESH message to request the routing information from the EBGP peer or peer group.
Examples
# In BGP instance view, enable BGP to ignore the first AS number of EBGP route updates received from peer group test.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] peer test ignore-first-as
Related commands
ignore-first-as
peer ignore-originatorid
Use peer ignore-originatorid to configure BGP to ignore the ORIGINATOR_ID attribute in BGP route updates.
Use undo peer ignore-originatorid to remove the configuration.
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } ignore-originatorid
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } ignore-originatorid
BGP does not ignore the ORIGINATOR_ID attribute in BGP route updates.
BGP-VPN instance 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.
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 ignores the ORIGINATOR_ID attribute in BGP route updates from all dynamic peers in the subnet.
ipv6-address: Specifies a peer 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 in this command, BGP ignores the ORIGINATOR_ID attribute in BGP route updates from all dynamic peers in the subnet.
Before using this command, make sure it does not cause any routing loops to the network.
Before forwarding a route received from a client, the route reflector adds an ORIGINATOR_ID attribute (the router ID of the client) to the route. By default, BGP drops incoming route updates whose ORIGINATOR_ID attribute is the same as the local router ID.
Some networks such as firewall networks require BGP to accept such route updates. To meet the requirement, you must configure BGP to ignore the ORIGINATOR_ID attribute.
After you execute this command, BGP also ignores the CLUSTER_LIST attribute.
# In BGP instance view, configure BGP to ignore the ORIGINATOR_ID attribute in BGP route updates from peer 1.1.1.1.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] peer 1.1.1.1 ignore-originatorid
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.
In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view/BGP VPNv4 address family view/BGP IPv4 multicast address family view:
peer { group-name | ipv4-address [ mask-length ] } keep-all-routes
undo peer { group-name | ipv4-address [ mask-length ] } keep-all-routes
In BGP IPv6 unicast address family view:
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
In BGP-VPN IPv6 unicast address family view/BGP IPv6 multicast address family view:
peer { group-name | ipv6-address [ prefix-length ] } keep-all-routes
undo peer { group-name | 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-VPN IPv4 unicast address family view
BGP VPNv4 address family view
BGP IPv6 unicast address family view
BGP-VPN IPv6 unicast address family view
BGP IPv4 multicast address family view
BGP IPv6 multicast 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 keychain
Use peer keychain to enable keychain authentication for a BGP peer or peer group.
Use undo peer keychain to remove keychain authentication for a BGP peer or peer group.
peer { group-name | ip-address [ mask-length ] | ipv6-address [ prefix-length ] } keychain keychain-name
undo peer { group-name | ip-address [ mask-length ] | ipv6-address [ prefix-length ] } keychain
Keychain authentication is disabled.
BGP instance view
BGP-VPN instance 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.
ip-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 keychain 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 keychain authentication for all dynamic peers in the subnet.
keychain-name: Specifies a keychain by its name, a case-sensitive string of 1 to 63 characters. The keychain must have been created.
Keychain authentication enhances the security of BGP in the following ways:
· BGP peers can establish TCP connections only when they are both enabled with keychain authentication.
· The keys used by the BGP peers at the same time must have the same ID.
· The keys with the same ID must use the same authentication algorithm and key string.
BGP supports the HMAC-MD5, HMAC-SHA-256, HMAC-SM3, SM3, and MD5 authentication algorithms. To specify an authentication algorithm for a key, use the authentication-algorithm command.
The IDs of keys used for authentication can only be in the range of 0 to 63. To create a key, use the key command.
The peer keychain and peer password commands are mutually exclusive.
# In BGP instance view, configure peer 10.1.1.1 to use keychain abc for authentication.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] peer 10.1.1.1 as-number 100
[Sysname-bgp-default] peer 10.1.1.1 keychain abc
Related commands
authentication-algorithm (Security Command Reference)
key (Security Command Reference)
peer password
peer log-change
Use peer log-change to enable logging for BGP session state changes for a peer or peer group.
Use undo peer log-change to disable logging for BGP session state changes for a peer or peer group.
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } log-change
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } log-change
Logging for BGP session state changes is enabled for all peers or peer groups.
BGP-VPN instance 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 already exist.
ipv4-address: Specifies the IPv4 address of a peer. The peer must already exist.
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 the logging of BGP session state changes for all dynamic peers in the subnet.
ipv6-address: Specifies the IPv6 address of a peer. The peer must already exist.
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 the logging of BGP session state changes for all dynamic peers in the subnet.
After you execute both the log-peer-change and peer log-change commands, BGP logs session establishment and disconnection events for the peer or peer group. To view the log information, use the display bgp peer ipv4 unicast log-info command or the display bgp peer ipv6 unicast log-info command. The logs are sent to the information center of the device. The output rules of the logs (whether to output the logs and where to output) are determined by the information center configuration. For more information about information center configuration, see Network Management and Monitoring Configuration Guide.
If you disable logging for BGP session state changes globally or disable logging for a peer or peer group, BGP does not generate logs for session establishments and disconnections.
# In BGP instance view, enable logging for BGP session state changes for 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 log-change
display bgp peer
log-peer-change
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.
BGP-VPN instance 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 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 Fundamentals 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 next-hop-local
Use peer next-hop-local to set the local router as the next hop for routes sent to a peer or peer group.
Use undo peer next-hop-local to remove the configuration.
In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view/BGP VPNv4 address family view/ BGP IPv4 multicast address family view:
peer { group-name | ipv4-address [ mask-length ] } next-hop-local
undo peer { group-name | ipv4-address [ mask-length ] } next-hop-local
In BGP IPv6 unicast address family view/BGP IPv6 multicast address family view:
peer { group-name | ipv6-address [ prefix-length ] } next-hop-local
undo peer { group-name | ipv6-address [ prefix-length ] } next-hop-local
BGP sets the local router as the next hop for all routes sent to an EBGP peer or peer group.
BGP sets the local router as the next hop for EBGP routes sent to an IBGP peer or peer group for BGP VPNv4 and VPNv6 address families. It does not set the local router as the next hop for EBGP routes sent to an IBGP peer or peer group for other address families.
BGP IPv4 unicast address family view
BGP-VPN IPv4 unicast address family view
BGP VPNv4 address family view
BGP IPv6 unicast address family view
BGP IPv4 multicast address family view
BGP IPv6 multicast 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 sets the local router as the next hop for routes sent 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 local router as the next hop for routes sent to all dynamic peers in the subnet.
By default, BGP does not set the local router as the next hop for EBGP routes sent to an IBGP peer or peer group. To ensure that an IBGP peer can find the next hop, you can use this command to specify the router as the next hop for routes sent to the IBGP peer.
The peer next-hop-local command is mutually exclusive with the peer next-hop-invariable command. Follow these restrictions and guidelines when you configure the commands for a peer or peer group:
· After you configure the peer next-hop-local command for a peer group, you cannot configure the peer next-hop-invariable command for the peer group or any peers in the peer group.
· After you configure the peer next-hop-local command for a peer, do not configure the peer next-hop-invariable command for the peer group to which the peer belongs. The configuration on the peer group will overwrite the configuration on the peer.
# In BGP IPv4 unicast address family view, specify the router as the next hop for routes sent to peer group test.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] peer test next-hop-local
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.
BGP-VPN instance 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 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.
The peer keychain and peer password commands are mutually exclusive.
# 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
Related commands
peer keychain
peer preferred-value
Use peer preferred-value to set a preferred value for routes received from a peer or peer group.
Use undo peer preferred-value to remove the configuration.
In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view/BGP VPNv4 address family view/BGP VPNv6 address family view/BGP IPv4 multicast address family view/BGP IPv4 RT filter address family view:
peer { group-name | ipv4-address [ mask-length ] } preferred-value value
undo peer { group-name | ipv4-address [ mask-length ] } preferred-value
In BGP IPv6 unicast address family view:
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } preferred-value value
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } preferred-value
In BGP-VPN IPv6 unicast address family view/BGP IPv6 multicast address family view:
peer { group-name | ipv6-address [ prefix-length ] } preferred-value value
undo peer { group-name | ipv6-address [ prefix-length ] } preferred-value
The preferred value is 0 for routes received from a peer or peer group.
BGP IPv4 unicast address family view
BGP-VPN IPv4 unicast address family view
BGP VPNv4 address family view
BGP IPv6 unicast address family view
BGP-VPN IPv6 unicast address family view
BGP VPNv6 address family view
BGP IPv4 multicast address family view
BGP IPv6 multicast address family view
BGP IPv4 RT filter 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 specifies a preferred value for routes received from 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 preferred value for routes received from all dynamic peers in the subnet.
value: Specifies a preferred value in the range of 0 to 65535.
If multiple routes that have the same destination are learned from different peers, you can specify different preferred values for the routes as needed to control BGP path selection. The one with the greatest preferred value is selected as the optimal route to the destination.
The preferred value is used for route selection on the local router and is not advertised to the peer. It has only local significance.
You can also use the apply preferred-value command in a routing policy to configure the preferred value for BGP routes. If both the peer preferred-value and apply preferred-value commands are configured, the apply preferred-value command applies. If the preferred value is not set in the routing policy or no routing policy is configured, the peer preferred-value command applies.
# In BGP IPv4 unicast address family view, set the preferred value to 50 for routes 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 preferred-value 50
apply preferred-value
route-policy
peer prefix-list
Use peer prefix-list to specify a prefix list to filter routes received from or advertised to a peer or peer group.
Use undo peer prefix-list to remove the prefix list specified to filter routes received from or advertised to a peer or peer group.
In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view/BGP VPNv4 address family view/BGP IPv4 multicast address family view:
peer { group-name | ipv4-address [ mask-length ] } prefix-list ipv4-prefix-list-name { export | import }
undo peer { group-name | ipv4-address [ mask-length ] } prefix-list { export | import }
In BGP IPv6 unicast address family view:
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } prefix-list ipv6-prefix-list-name { export | import }
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } prefix-list { export | import }
In BGP-VPN IPv6 unicast address family view/BGP IPv6 multicast address family view:
peer { group-name | ipv6-address [ prefix-length ] } prefix-list ipv6-prefix-list-name { export | import }
undo peer { group-name | ipv6-address [ prefix-length ] } prefix-list { export | import }
In BGP VPNv6 address family view:
peer { group-name | ipv4-address [ mask-length ] } prefix-list ipv6-prefix-list-name { export | import }
undo peer { group-name | ipv4-address [ mask-length ] } prefix-list { export | import }
No prefix list based filtering is configured.
BGP IPv4 unicast address family view
BGP-VPN IPv4 unicast address family view
BGP VPNv4 address family view
BGP IPv6 unicast address family view
BGP-VPN IPv6 unicast address family view
BGP VPNv6 address family view
BGP IPv4 multicast address family view
BGP IPv6 multicast 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 uses a prefix list to filter routes received from or 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 uses a prefix list to filter routes received from or advertised to all dynamic peers in the subnet.
ipv4-prefix-list-name: Specifies an IPv4 prefix list by its name, a case-sensitive string of 1 to 63 characters.
export: Applies the filter to routes advertised to the specified peer/peer group.
import: Applies the filter to routes received from the specified peer/peer group.
The specified prefix list must have been created with the ip prefix-list or ipv6 prefix-list command in system view. If you specify a nonexistent IPv4/IPv6 prefix list, all routes can pass the prefix list.
# In BGP IPv4 unicast address family view, use IPv4 prefix list list1 to filter routes advertised to peer group test.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] peer test prefix-list list1 export
filter-policy export
filter-policy import
ip prefix-list
ipv6 prefix-list
peer as-path-acl
peer filter-policy
peer route-policy
peer public-as-only
Use peer public-as-only to remove private AS numbers in BGP updates sent to an EBGP peer or peer group.
Use undo peer public-as-only to remove the configuration.
In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view/BGP VPNv4 address family view/BGP VPNv6 address family view/BGP IPv4 multicast address family view:
peer { group-name | ipv4-address [ mask-length ] } public-as-only
undo peer { group-name | ipv4-address [ mask-length ] } public-as-only
In BGP IPv6 unicast address family view:
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } public-as-only
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } public-as-only
In BGP-VPN IPv6 unicast address family view/BGP IPv6 multicast address family view:
peer { group-name | ipv6-address [ prefix-length ] } public-as-only
undo peer { group-name | ipv6-address [ prefix-length ] } public-as-only
BGP updates sent to an EBGP peer or peer group can carry both public and private AS numbers.
BGP IPv4 unicast address family view
BGP-VPN IPv4 unicast address family view
BGP VPNv4 address family view
BGP IPv6 unicast address family view
BGP-VPN IPv6 unicast address family view
BGP VPNv6 address family view
BGP IPv4 multicast address family view
BGP IPv6 multicast 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 removes private AS numbers in BGP updates sent 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 removes private AS numbers in BGP updates sent to all dynamic peers in the subnet.
Private AS numbers are typically used in test networks, and need not be transmitted in public networks. The range of private AS numbers is from 64512 to 65535.
After you execute the command, you can get the following results:
· If the AS_PATH attribute of a BGP update carries only private AS numbers, the device removes the AS numbers before sending the update to the EBGP peer or peer group.
· If the AS_PATH attribute carries both public and private AS numbers, the command does not take effect. The device sends the BGP update to the EBGP peer or peer group without removing the private AS numbers.
· If the AS_PATH attribute carries AS numbers of the peer or peer group, the command does not take effect. The device sends the BGP update to the peer or peer group without removing the private AS numbers.
This command is applicable only to EBGP peers and peer groups.
# In BGP IPv4 unicast address family view, remove private AS numbers in BGP updates sent to EBGP peer group test.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] peer test public-as-only
peer reflect-client
Use peer reflect-client to configure the device as a route reflector and specify a peer or peer group as a client.
Use undo peer reflect-client to remove the configuration.
In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view/BGP VPNv4 address family view/BGP VPNv6 address family view/BGP IPv4 multicast address family view/BGP IPv4 MDT address family view/BGP IPv4 RT filter address family view/BGP MVPN address family view:
peer { group-name | ipv4-address [ mask-length ] } reflect-client
undo peer { group-name | ipv4-address [ mask-length ] } reflect-client
In BGP IPv6 unicast address family view:
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } reflect-client
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } reflect-client
In BGP LS address family view:
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } reflect-client
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } reflect-client
In BGP IPv6 multicast address family view:
peer { group-name | ipv6-address [ prefix-length ] } reflect-client
undo peer { group-name | ipv6-address [ prefix-length ] } reflect-client
Neither the route reflector nor the client is configured.
BGP IPv4 unicast address family view
BGP-VPN IPv4 unicast address family view
BGP VPNv4 address family view
BGP IPv6 unicast address family view
BGP LS address family view
BGP VPNv6 address family view
BGP IPv4 multicast address family view
BGP IPv6 multicast address family view
BGP IPv4 MDT address family view
BGP IPv4 RT filter address family view
BGP MVPN 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 device as a route reflector and specifies all dynamic peers in the subnet as clients.
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 device as a route reflector and specifies all dynamic peers in the subnet as clients.
Using route reflectors can solve the issue brought by too many IBGP connections. After you configure a device as a route reflector in an AS, it advertises routes as follows:
· Advertises routes received from a non-client IBGP peer to all clients.
· Advertises routes received from an IBGP peer that acts as a client to all peers.
· Advertises routes received from an EBGP peer to all peers.
# In BGP IPv4 unicast address family view, configure the local device as a route reflector and specify IBGP peer group test as a client.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] peer test reflect-client
reflect between-clients
reflector cluster-id
peer route-limit
Use peer route-limit to set the maximum number of routes that can be received from a peer or peer group.
Use undo peer route-limit to remove the configuration.
In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view/BGP VPNv4 address family view/BGP VPNv6 address family view/BGP IPv4 multicast address family view:
peer { group-name | ipv4-address [ mask-length ] } route-limit prefix-number [ { alert-only | discard | reconnect reconnect-time } | percentage-value ] *
undo peer { group-name | ipv4-address [ mask-length ] } route-limit
In BGP IPv6 unicast address family view:
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } route-limit prefix-number [ { alert-only | discard | reconnect reconnect-time } | percentage-value ] *
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } route-limit
In BGP IPv6 multicast address family view:
peer { group-name | ipv6-address [ prefix-length ] } route-limit prefix-number [ { alert-only | discard | reconnect reconnect-time } | percentage-value ] *
undo peer { group-name | ipv6-address [ prefix-length ] } route-limit
The number of routes that can be received from a peer or peer group is not limited.
BGP IPv4 unicast address family view
BGP-VPN IPv4 unicast address family view
BGP VPNv4 address family view
BGP IPv6 unicast address family view
BGP VPNv6 address family view
BGP IPv4 multicast address family view
BGP IPv6 multicast 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 specifies the maximum number of routes that can be received from 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 the maximum number of routes that can be received from all dynamic peers in the subnet.
prefix-number: Specifies the number of routes that can be received from the peer or peer group.The value range for this argument is 1 to 4294967295.The router will tear down the session to the peer or peer group if the following conditions exist:
· The alert-only, discard, and reconnect keywords are not specified.
· The number of routes received from the peer or peer group reaches the prefix-number.
The router will not attempt to re-establish the session to a dynamic BGP peer until the router receives a connection request from the peer. For other peers, you can use the reset bgp command to re-establish the sessions.
alert-only: If the number of routes received from the peer or peer group reaches the prefix-number, the router generates a log message instead of tearing down the session to the peer or peer group. The router can continue to receive routes from the peer or peer group.
discard: If the number of routes received from the peer or peer group reaches the prefix-number, the router retains the session to the peer or peer group. However, it discards excess routes and generates a log message. After the number of routes received from the peer or peer group falls below the prefix-number, the router can continue to receive routes from the peer or peer group. To restore the discarded routes, use the refresh bgp import command to request the peer or peer group to resend the routes.
reconnect reconnect-time: Specifies a reconnect time. After the specified time is reached, the router re-establishes a session to the peer or peer group when the number of routes received from the peer or peer group reaches the prefix-number. The value range for the reconnect-time argument is 1 to 65535 seconds. This option is not available for dynamic BGP peers.
percentage-value: Specifies the threshold value for the router to generate a log message (the router generates a log message when the ratio of the number of received routes to the prefix-number exceeds the percentage value). The value range of this argument is 1 to 100, and the default is 75.
# In BGP IPv4 unicast address family view, set the maximum number of routes that can be received from peer 1.1.1.1 to 10000. Configure the router to tear down the session to the peer if the number is exceeded.
<Sysname> system-view
[Sysname] bgp 109
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] peer 1.1.1.1 route-limit 10000
peer route-policy
Use peer route-policy to apply a routing policy to routes incoming from or outgoing to a peer or peer group.
Use undo peer route-policy to remove the configuration.
In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view/BGP VPNv4 address family view/BGP VPNv6 address family view/BGP IPv4 multicast address family view:
peer { group-name | ipv4-address [ mask-length ] } route-policy route-policy-name { export | import }
undo peer { group-name | ipv4-address [ mask-length ] } route-policy { export | import }
In BGP-VPN VPNv4 address family view:
peer { group-name | ipv4-address [ mask-length ] } route-policy route-policy-name import
undo peer { group-name | ipv4-address [ mask-length ] } route-policy import
In BGP IPv6 unicast address family view:
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } route-policy route-policy-name { export | import }
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } route-policy { export | import }
In BGP-VPN IPv6 unicast address family view/BGP IPv6 multicast address family view:
peer { group-name | ipv6-address [ prefix-length ] } route-policy route-policy-name { export | import }
undo peer { group-name | ipv6-address [ prefix-length ] } route-policy { export | import }
No routing policy is applied to routes incoming from or outgoing to a peer or peer group.
BGP IPv4 unicast address family view
BGP-VPN IPv4 unicast address family view
BGP VPNv4 address family view
BGP-VPN VPNv4 address family view
BGP IPv6 unicast address family view
BGP-VPN IPv6 unicast address family view
BGP VPNv6 address family view
BGP IPv4 multicast address family view
BGP IPv6 multicast 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 applies a routing policy to routes incoming from or outgoing 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 applies a routing policy to routes incoming from or outgoing to all dynamic peers in the subnet.
route-policy-name: Specifies a routing policy by its name, a case-sensitive string of 1 to 63 characters.
export: Applies the routing policy to routes outgoing to the peer or peer group.
import: Applies the routing policy to routes incoming from the peer or peer group.
The specified routing policy must have been configured with the route-policy command in system view. If you specify a nonexistent routing policy, all routes can pass the routing policy.
The apply clause that modifies the AS path does not take effect in a routing policy applied to routes outgoing to an IBGP peer or peer group.
The if-match interface command, if configured for the applied routing policy, does not take effect on routes.
# In BGP IPv4 unicast address family view, apply routing policy test-policy to routes outgoing to peer group test.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] peer test route-policy test-policy export
filter-policy export
filter-policy import
peer as-path-acl
peer filter-policy
peer prefix-list
route-policy
peer route-update-interval
Use peer route-update-interval to specify an interval for sending the same update to a peer or peer group.
Use undo peer route-update-interval to remove the configuration.
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } route-update-interval interval
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } route-update-interval
The interval for sending the same update to an IBGP peer is 15 seconds and the interval for sending the same update to an EBGP peer is 30 seconds.
BGP-VPN instance 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 specifies an interval for sending the same update 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 an interval for sending the same update to all dynamic peers in the subnet.
interval: Specifies a minimum interval for sending the same update message, in the range of 0 to 600 seconds.
A BGP router sends an update message to its peers when a route is changed. If the route changes frequently, the BGP router sends many updates for the route, resulting in routing flaps. By configuring the interval for sending the same update to a peer or peer group, you can avoid such routing flaps. This command does not take effect on withdrawn routes. For withdrawn routes, BGP sends the withdrawal messages immediately.
# In BGP instance view, set the interval for sending the same update to peer group test to 10 seconds.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] peer test as-number 100
[Sysname-bgp-default] peer test route-update-interval 10
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.
In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view/BGP VPNv4 address family view/BGP-VPN VPNv4 address family view/BGP VPNv6 address family view/BGP IPv4 multicast address family view:
peer { group-name | ipv4-address [ mask-length ] } soo site-of-origin
undo peer { group-name | ipv4-address [ mask-length ] } soo
In BGP IPv6 unicast address family view:
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
In BGP-VPN IPv6 unicast address family view/BGP IPv6 multicast address family view:
peer { group-name | ipv6-address [ prefix-length ] } soo site-of-origin
undo peer { group-name | ipv6-address [ prefix-length ] } soo
No SoO attribute is configured for a peer or peer group.
BGP IPv4 unicast address family view
BGP-VPN IPv4 unicast address family view
BGP VPNv4 address family view
BGP-VPN VPNv4 address family view
BGP IPv6 unicast address family view
BGP-VPN IPv6 unicast address family view
BGP VPNv6 address family view
BGP IPv4 multicast address family view
BGP IPv6 multicast 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 21 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.
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 source-address
Use peer source-address to specify a source IPv4 or IPv6 address for establishing TCP connections to a peer or peer group.
Use undo peer source-address to remove the configuration.
peer ipv4-address [ mask-length ] source-address source-ipv4-address
peer ipv6-address [ prefix-length ] source-address source-ipv6-address
undo peer { ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } source-address
peer group-name source-address { source-ipv4-address | source-ipv6-address } *
undo peer group-name source-address [ source-ipv4-address | source-ipv6-address ]
BGP uses the primary IPv4 or IPv6 address of the output interface in the optimal route destined for the BGP peer or peer group as the source address for TCP connection establishment.
BGP-VPN instance view
network-admin
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 source IP address for establishing TCP connections to all dynamic peers in the subnet.
source-ipv4-address: Specifies a source IPv4 address.
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 source IPv6 address for establishing TCP connections to all dynamic peers in the subnet.
source-ipv6-address: Specifies a source IPv6 address.
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.
The peer connect-interface command and the peer source-address command can both change the source address for establishing TCP connections. If you execute both commands, the most recent configuration takes effect.
The peer source-address and peer connect-interface commands are applicable to the following scenarios:
· The peer's IPv4/IPv6 address does not belong to the interface directly connected to the local router. To ensure successful TCP connection establishment, use one of the following methods:
¡ Specify the interface to which the IPv4/IPv6 address belongs as the source interface on the peer.
¡ Specify the IPv4/IPv6 address of the interface directly connected to the local router as the source address on the peer.
· A BGP peer at an IPv6 link-local address must be directly connected to the local router. On the local router, you must use the peer connect-interface command to specify the interface directly connected to the BGP peer as the source interface of TCP connections.
· On a BGP router that has multiple links to a peer, the source interface for TCP connection changes because the primary source interface fails. To avoid this problem, specify a loopback interface as the source interface or specify the IP address of a loopback interface as the source address.
· You want to establish multiple BGP sessions to a router. In this case, BGP might fail to determine the source address for each TCP connection based on the optimal route to the peer. To prevent this problem, use one of the following methods:
¡ If the BGP sessions use IP addresses of different interfaces, specify a source interface or source address for each session.
¡ If the BGP sessions use different IP addresses of the same interface, specify a source address for each session.
The source addresses on the local router and the peer must be reachable to each other.
To specify the address of an indirectly connected interface as the source address, use the peer ebgp-max-hop command. The command allows the establishment of an EBGP session to the indirectly connected peer.
You can specify both a source IPv4 address and a source IPv6 address for a peer group. BGP uses the source IPv4 address to establish TCP connections to IPv4 peers in the group. It also uses the source IPv6 address to establish TCP connections to IPv6 peers in the group.
# In BGP instance view, specify source IPv4 address 1.1.1.1 for peer group test.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] peer test source-address 1.1.1.1
peer connect-interface
peer ebgp-max-hop
peer timer
Use peer timer to set a keepalive interval and hold time for a peer or peer group.
Use undo peer timer to remove the configuration.
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } timer keepalive keepalive hold holdtime
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } timer
The keepalive interval is 60 seconds, and the hold time is 180 seconds.
BGP-VPN instance 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 a keepalive interval and hold time 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 a keepalive interval and hold time for all dynamic peers in the subnet.
keepalive keepalive: Sets a keepalive interval in the range of 0 to 21845 seconds.
hold holdtime: Sets a hold time in the range of 3 to 65535 seconds. The hold time must be at least three times the keepalive interval.
After establishing a BGP session, two routers send keepalive messages at the specified keepalive interval to each other to keep the session.
If a router receives no keepalive or update message from the peer within the hold time, it tears down the session.
The timers configured with this command are preferred to the timers configured with the timer command.
If the hold time settings on the local and peer routers are different, the smaller one is used.
If the hold time is set to 0, no keepalive message will be sent to the peer, and the peer session will never time out. If neither the hold time nor the keepalive interval is set to 0, the actual keepalive interval is the smaller one between one third of the hold time and the keepalive interval.
The timers configured with this command do not take effect until a session is re-established (for example, a session is reset).
# In BGP instance view, set the keepalive interval and hold time for peer group test to 60 seconds and 180 seconds, respectively.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] peer test timer keepalive 60 hold 180
display bgp peer
timer
peer timer connect-retry
Use peer timer connect-retry to set the session retry timer for a peer or peer group.
Use undo peer timer connect-retry to remove the configuration.
Syntax
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } timer connect-retry retry-time
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } timer connect-retry
Default
The session retry timer is 32 seconds a 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 sets a connection retry timer 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 sets a connection retry timer for all dynamic peers in the subnet.
retry-time: Specifies a session retry timer in the range of 1 to 65535 seconds.
Usage guidelines
To speed up session establishment to a peer or peer group and route convergence, set a small session retry timer. If the BGP session flaps, you can set a large session retry timer to reduce the impact.
The timer set by the peer timer connect-retry command takes precedence over the timer set by the timer connect-retry command.
Examples
# In BGP instance view, set the session retry timer to 30 seconds for peer 1.1.1.1.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] peer 1.1.1.1 timer connect-retry 30
Related commands
timer connect-retry
peer ttl-security
Use peer ttl-security to configure Generalized TTL Security Mechanism (GTSM) for a BGP peer or peer group.
Use undo peer ttl-security to disable BGP GTSM for a peer or peer group.
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } ttl-security hops hop-count
undo peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } ttl-security hops
GTSM is disabled for BGP.
BGP-VPN instance 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 GTSM 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 GTSM for all dynamic peers in the subnet.
hops hop-count: Specifies the maximum number of hops to the specified peer, in the range of 1 to 254.
GTSM protects a BGP session by comparing the TTL value of an incoming IP packet against the valid TTL range. If the TTL value is within the valid TTL range, the packet is accepted. If not, the packet is discarded.
The valid TTL range is from 255 – the configured hop count + 1 to 255.
When GTSM is configured, the BGP packets sent by the device have a TTL of 255.
When GTSM is configured, the local device can establish an EBGP session to the peer after they pass GTSM check, regardless of whether the maximum number of hops is reached.
To use GTSM, you must configure GTSM on both the local and peer devices. You can specify different hop-count values for them.
# In BGP instance view, enable GTSM for BGP peer group test and set the maximum number of hops to the specified peer in the peer group to 1.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] peer test ttl-security hops 1
peer ebgp-max-hop
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-VPN IPv4 unicast address family view
BGP IPv6 unicast address family view
BGP-VPN 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
preference
Use preference to configure preferences for BGP routes.
Use undo preference to restore the default.
preference { external-preference internal-preference local-preference | route-policy route-policy-name }
undo preference
The preferences of external, internal, and local BGP routes are 255, 255, and 130, respectively.
BGP IPv4 unicast address family view
BGP-VPN IPv4 unicast address family view
BGP IPv6 unicast address family view
BGP-VPN IPv6 unicast address family view
BGP IPv4 multicast address family view
BGP IPv6 multicast address family view
network-admin
external-preference: Specifies a preference for EBGP routes, in the range of 1 to 255.
internal-preference: Specifies a preference for IBGP routes, in the range of 1 to 255.
local-preference: Specifies a preference for local routes, in the range of 1 to 255.
route-policy route-policy-name: Specifies a routing policy by its name, a case-sensitive string of 1 to 63 characters, to set the route preference for matching routes. Routes not matching the routing policy use the default preference.
Different routing protocols might find different routes to the same destination. However, not all of those routes are optimal. For route selection, routing protocols, direct routes, and static routes are assigned different preferences. The route with the highest preference is preferred.
Configuring the preferences for BGP routes changes the possibility for the routes to become the optimal route.
To use a routing policy to set the preference, you must configure the preference with the apply preference command in the routing policy in advance. Otherwise, all matching routes use the default preference.
# In BGP IPv4 unicast address family view, set preferences for EBGP, IBGP, and local routes to 20, 20, and 200, respectively.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] preference 20 20 200
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 echo
undo primary-path-detect bfd
BGP FRR uses ARP to detect the connectivity to the next hop of the primary route.
network-admin
echo: Uses echo-mode BFD to detect the connectivity to the next hop of the primary route.
# 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
reflect between-clients
Use reflect between-clients to enable route reflection between clients.
Use undo reflect between-clients to disable route reflection between clients.
reflect between-clients
undo reflect between-clients
Route reflection between clients is enabled.
BGP IPv4 unicast address family view
BGP-VPN IPv4 unicast address family view
BGP VPNv4 address family view
BGP IPv6 unicast address family view
BGP LS address family view
BGP VPNv6 address family view
BGP IPv4 multicast address family view
BGP IPv6 multicast address family view
BGP IPv4 MDT address family view
BGP IPv4 RT filter address family view
BGP MVPN address family view
network-admin
When a route reflector is configured, and the clients of a route reflector are fully meshed, route reflection is unnecessary because it consumes more bandwidth resources. You can use the undo reflect between-clients command to disable route reflection instead of modifying network configuration or changing network topology.
After route reflection is disabled between clients, routes can still be reflected between a client and a non-client.
# In BGP IPv4 unicast address family view, disable route reflection between clients.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] undo reflect between-clients
peer reflect-client
reflector cluster-id
Use reflector cluster-id to configure the cluster ID for a route reflector.
Use undo reflector cluster-id to restore the default.
reflector cluster-id { cluster-id | ipv4-address }
undo reflector cluster-id
A route reflector uses its router ID as the cluster ID.
BGP IPv4 unicast address family view
BGP-VPN IPv4 unicast address family view
BGP VPNv4 address family view
BGP IPv6 unicast address family view
BGP LS address family view
BGP VPNv6 address family view
BGP IPv4 multicast address family view
BGP IPv6 multicast address family view
BGP IPv4 MDT address family view
BGP IPv4 RT filter address family view
BGP MVPN address family view
network-admin
cluster-id: Specifies the cluster ID in the format of an integer, in the range of 1 to 4294967295.
ipv4-address: Specifies the cluster ID in the format of an IPv4 address in dotted decimal notation.
The route reflector and clients form a cluster. Typically a cluster has one route reflector. The ID of the route reflector is the cluster ID.
You can configure more than one route reflector in a cluster to improve network reliability and prevent a single point of failure. Use this command to configure the same cluster ID for all route reflectors in the cluster to avoid routing loops.
Do not configure the router ID of a client as the cluster ID.
# In BGP IPv4 unicast address family view, set the cluster ID on the local router (a reflector in the cluster) to 80.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] reflector cluster-id 80
peer reflect-client
reflect between-clients
refresh bgp
Use refresh bgp to manually soft-reset BGP sessions.
refresh bgp [ instance instance-name ] { ipv4-address [ mask-length ] | all | external | group group-name | internal } { export | import } ipv4 [ multicast | mvpn | rtfilter | [ unicast ] [ vpn-instance vpn-instance-name ] ]
refresh bgp [ instance instance-name ] { ipv6-address [ prefix-length ] | all | external | group group-name | internal } { export | import } ipv6 [ multicast | [ unicast ] [ vpn-instance vpn-instance-name ] ]
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
refresh bgp [ instance instance-name ] { ipv4-address [ mask-length ] | all | external | group group-name | internal } { export | import } vpnv4 [ vpn-instance vpn-instance-name ]
refresh bgp [ instance instance-name ] { ipv4-address [ mask-length ] | all | external | group group-name | internal } { export | import } vpnv6
network-admin
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.
multicast: Soft-resets BGP sessions for multicast address family.
mvpn: Soft-resets BGP sessions for MVPN address family.
rtfilter: Soft-resets BGP sessions for IPv4 RT filter address family.
unicast: Soft-resets BGP sessions for unicast address family.
vpnv4: Soft-resets BGP sessions for VPNv4 address family.
vpnv6: Soft-resets BGP sessions for VPNv6 address family.
vpn-instance vpn-instance-name: Specifies an MPLS L3VPN instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command soft-resets BGP sessions for the specified address family on the public network.
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 the multicast, unicast, and rtfilter keywords are not specified.
# Soft-reset all inbound BGP sessions for the IPv4 unicast address family.
<Sysname> refresh bgp all import ipv4
peer capability-advertise route-refresh
peer keep-all-routes
reset bgp
Use reset bgp to reset BGP sessions for the specified address family.
reset bgp [ instance instance-name ] { as-number | ipv4-address [ mask-length ] | all | external | group group-name | internal } ipv4 [ mdt | multicast | mvpn | rtfilter | [ unicast ] [ vpn-instance vpn-instance-name ] ]
reset bgp [ instance instance-name ] { as-number | ipv6-address [ prefix-length ] | all | external | group group-name | internal } ipv6 [ multicast | [ unicast ] [ vpn-instance vpn-instance-name ] ]
reset bgp [ instance instance-name ] ipv4-address [ mask-length ] ipv6 [ unicast ]
reset bgp [ instance instance-name ] { as-number | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] | all | external | group group-name | internal } link-state
reset bgp [ instance instance-name ] { as-number | ipv4-address [ mask-length ] | all | external | group group-name | internal } vpnv4 [ vpn-instance vpn-instance-name ]
reset bgp [ instance instance-name ] { as-number | ipv4-address [ mask-length ] | all | external | group group-name | internal } vpnv6
network-admin
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 resets BGP sessions for the default BGP instance.
as-number: Resets BGP sessions to peers in the AS specified by its number in the range of 1 to 4294967295.
ipv4-address: Resets the BGP session to a peer specified by its IPv4 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 resets BGP sessions to all dynamic peers in the subnet.
ipv6-address: 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 resets BGP sessions to all dynamic peers in the subnet.
all: Resets all BGP sessions.
external: Resets all EBGP sessions.
group group-name: Resets the BGP sessions to the peers in the peer group specified by its name, a case-sensitive string of 1 to 47 characters.
internal: Resets all IBGP sessions.
ipv4: Resets BGP sessions for IPv4 address family.
ipv6: Resets BGP sessions for IPv6 address family.
link-state: Resets BGP sessions for LS address family.
mdt: Resets BGP sessions for MDT address family.
multicast: Resets BGP sessions for multicast address family.
mvpn: Resets BGP sessions for MVPN address family.
rtfilter: Resets BGP sessions for IPv4 RT filter address family.
unicast: Resets BGP sessions for unicast address family.
vpnv4: Resets BGP sessions for VPNv4 address family.
vpnv6: Resets BGP sessions for VPNv6 address family.
vpn-instance vpn-instance-name: Specifies an MPLS L3VPN instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command resets BGP sessions for the specified address family on the public network.
CAUTION: A reset operation tears down BGP sessions for a short period of time. |
A reset operation enables the router to apply a new route selection policy by re-establishing BGP sessions.
By default, the unicast keyword is used if the unicast, mdt, mvpn, rtfilter, and multicast keywords are not specified.
# Reset all BGP sessions for the IPv4 unicast address family.
reset bgp all
Use reset bgp all to reset all BGP sessions for all address families.
reset bgp [ instance instance-name ] all
network-admin
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 resets all BGP sessions for all address families of the default BGP instance.
CAUTION: A reset operation tears down BGP sessions for a short period of time. |
A reset operation enables the router to apply a new route selection policy by re-establishing BGP sessions.
# Reset all BGP sessions.
reset bgp dampening
Use reset bgp dampening to clear BGP route dampening information and release suppressed BGP routes.
reset bgp [ instance instance-name ] dampening ipv4 [ multicast | [ unicast ] [ vpn-instance vpn-instance-name ] ] [ ipv4-address [ mask-length | mask ] ]
reset bgp [ instance instance-name ] dampening ipv6 [ multicast | [ unicast ] [ vpn-instance vpn-instance-name ] ] [ ipv6-address prefix-length ]
reset bgp [ instance instance-name ] dampening vpnv4 [ ipv4-address [ mask | mask-length ] ]
network-admin
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 clears BGP route dampening information and releases suppressed BGP routes for the default BGP instance.
ipv4: Clears BGP IPv4 route dampening information and releases suppressed BGP IPv4 routes.
ipv6: Clears BGP IPv6 route dampening information and releases suppressed BGP IPv6 routes.
vpnv4: Clears IBGP VPNv4 route dampening information and releases suppressed IBGP VPNv4 routes.
multicast: Clears BGP multicast route dampening information and releases suppressed BGP multicast routes.
unicast: Clears BGP unicast route dampening information and releases suppressed BGP unicast routes.
vpn-instance vpn-instance-name: Specifies an MPLS L3VPN instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command clears BGP route dampening information for the public network, and releases suppressed BGP routes.
ipv4-address: Specifies an IPv4 destination network address. If you do not specify a network address, this command clears all BGP route dampening information, and releases all suppressed BGP routes.
mask-length: Specifies a mask length in the range of 0 to 32.
mask: Specifies a network mask in dotted decimal notation.
ipv6-address: Specifies an IPv6 destination network address. If you do not specify a network address, this command clears all BGP route dampening information, and releases all suppressed BGP routes.
prefix-length: Specifies a prefix length in the range of 0 to 128.
When you execute the reset bgp dampening ipv4 command:
· If you specify only the ipv4-address argument, the system ANDs the network address with the mask of a route. If the result matches the network address of the route, the command clears dampening information for the route, and releases the suppressed route.
· If you specify the ipv4-address mask or ipv4-address mask-length argument, this command does the following:
¡ Clears dampening information for the route that matches both the specified destination network address and the mask (or mask length).
¡ Releases the suppressed route.
By default, the unicast keyword is used if neither the unicast keyword nor the multicast keyword is specified.
# Clear dampening information for the BGP IPv4 unicast route to network 20.1.0.0/16 and release the suppressed route.
<Sysname> reset bgp dampening ipv4 20.1.0.0 255.255.0.0
dampening
display bgp routing-table dampened
reset bgp flap-info
Use reset bgp flap-info to clear flap statistics for BGP routes.
reset bgp [ instance instance-name ] flap-info ipv4 [ multicast | [ unicast ] [ vpn-instance vpn-instance-name ] ] [ ipv4-address [ mask-length | mask ] | as-path-acl as-path-acl-number | peer ipv4-address [ mask-length ] ]
reset bgp [ instance instance-name ] flap-info ipv6 [ multicast | [ unicast ] [ vpn-instance vpn-instance-name ] ] [ ipv6-address prefix-length | as-path-acl as-path-acl-number | peer ipv6-address [ prefix-length ] ]
reset bgp [ instance instance-name ] flap-info vpnv4 [ ipv4-address [ mask | mask-length ] | as-path-acl as-path-acl-number | peer ipv4-address [ mask-length ] ]
network-admin
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 clears flap statistics for the default BGP instance.
ipv4: Clears flap statistics for BGP IPv4 routes.
ipv6: Clears flap statistics for BGP IPv6 routes.
vpnv4: Clears flap statistics for IBGP VPNv4 routes.
multicast: Clears flap statistics for BGP multicast routes.
unicast: Clears flap statistics for BGP unicast routes.
vpn-instance vpn-instance-name: Specifies an MPLS L3VPN instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command clears flap statistics for public BGP routes.
ipv4-address: Specifies an IPv4 destination network address.
mask-length: Specifies a mask length in the range of 0 to 32.
mask: Specifies a network mask in dotted decimal notation.
ipv6-address: Specifies an IPv6 destination network address.
prefix-length: Specifies a prefix length in the range of 0 to 128.
as-path-acl as-path-acl-number: Specifies an AS path list by its number in the range of 1 to 256, to filter BGP route flap statistics.
peer ipv4-address [ mask-length ]: Clears flap statistics for BGP routes learned from the specified IPv4 BGP peer. The mask-length argument 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 clears flap statistics for BGP routes learned from all dynamic peers in the subnet.
peer ipv6-address [ prefix-length ]: Clears flap statistics for BGP routes learned from the specified IPv6 BGP peer. The prefix-length argument 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 clears flap statistics for BGP routes learned from all dynamic peers in the subnet.
When you execute the reset bgp flap-info ipv4 command:
· If you specify only the ipv4-address argument, the system ANDs the IPv4 network address with the mask of a route. If the result matches the IPv4 network address of the route, this command clears the flap statistics of the route.
· If you specify the ipv4-address mask or ipv4-address mask-length argument, this command clears the flap statistics of the route that matches both the specified IPv4 destination network address and the mask (or mask length).
By default, the unicast keyword is used if neither the unicast keyword nor the multicast keyword is specified.
# Clear flap statistics for the BGP IPv4 unicast route to network 20.1.0.0/16.
<Sysname> reset bgp flap-info ipv4 20.1.0.0 16
dampening
display bgp routing-table flap-info
router id
Use router id to configure a global router ID.
Use undo router id to restore the default.
router id router-id
undo router id
No global router ID is configured.
network-admin
router-id: Specifies a router ID in IP address format.
Some routing protocols use a router ID to identify a device. You can configure a global router ID, which is used by routing protocols that have no router ID configured.
If no global router ID is configured, the highest loopback address, if any, is used as the router ID. If no loopback address is available, the highest physical interface IP address is used, regardless of the interface status. If no IP address is configured for any interface, the router ID is 0.0.0.0.
During an active/standby switchover, the standby main processing unit (MPU) checks the validity of the previous router ID backed up before switchover. If it is not valid, it selects a new router ID.
If the interface IP address that is selected as the router ID is removed or modified, a new router ID is selected. The following events will not trigger a router ID re-selection:
· The interface goes down.
· After a physical interface address is selected as the router ID, an IP address is configured for a loopback interface.
· A higher interface IP address is configured.
After you modify the global router ID and reset BGP sessions, the modification does not take effect for a BGP instance that uses the global router ID. To modify the router ID for the BGP instance, use the router-id command in BGP instance view.
# Configure a global router ID as 1.1.1.1.
<Sysname> system-view
[Sysname] router id 1.1.1.1
router-id (BGP instance view)
router-id (BGP-VPN instance view)
router-id (BGP instance view)
Use router-id to configure a router ID for a BGP instance.
Use undo router-id to restore the default.
router-id router-id
undo router-id
No router ID is configured for a BGP instance, and the BGP instance uses the global router ID configured by the router id command in system view.
network-admin
router-id: Specifies a router ID for BGP, in IP address format.
To run BGP, a BGP instance must have a router ID, which is an unsigned 32-bit integer that uniquely identifies the router in the AS.
To modify a non-zero router ID for BGP, execute the router-id command in BGP instance view.
To improve availability, specify the IP address of a loopback interface as the router ID for BGP.
If you execute this command in the same BGP instance view multiple times, the most recent configuration takes effect.
You can configure the same router ID for different BGP instances.
# In BGP instance view, set the router ID for BGP to 1.1.1.1.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] router-id 1.1.1.1
router id
router-id (BGP-VPN instance view)
router-id (BGP-VPN instance view)
Use router-id to configure a router ID for a BGP VPN instance.
Use undo router-id to restore the default.
router-id { router-id | auto-select }
undo router-id
No router ID is configured for a BGP VPN instance, and the BGP VPN instance uses the router ID configured in BGP instance view. If no router ID is configured in BGP instance view, the BGP VPN instance uses the global router ID configured in system view.
network-admin
router-id: Specifies a router ID in IP address format.
auto-select: Automatically selects a router ID for the BGP VPN instance.
To run BGP, a VPN instance of a BGP instance must have a router ID, which is an unsigned 32-bit integer that uniquely identifies the BGP VPN router in the AS.
If the auto-select keyword is specified, the system selects a router ID for the BGP VPN instance in the following order:
1. The highest loopback address in the BGP VPN instance as the router ID.
2. The highest physical interface address in the BGP VPN instance as the router ID, regardless of the interface status.
3. 0.0.0.0 as the router ID.
If a non-zero router ID is selected for the BGP VPN instance, the router ID will not change when a more preferable router ID is available in the BGP VPN instance.
To improve availability, specify the IP address of a loopback interface as the router ID.
You can specify a different router ID for each VPN instance on a device.
If you execute this command in the same BGP-VPN instance view multiple times, the most recent configuration takes effect.
# In BGP-VPN instance view, set the router ID to 1.1.1.1.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] ip vpn-instance vpn1
[Sysname-bgp-default-vpn1] router-id 1.1.1.1
router id
router-id (BGP instance view)
snmp context-name
Use snmp context-name to configure an SNMP context for a BGP instance.
Use undo snmp context-name to restore the default.
snmp context-name context-name
undo snmp context-name
No SNMP context is configured for a BGP instance.
network-admin
context-name: Specifies an SNMP context by its name, a case-sensitive string of 1 to 32 characters.
BGP does not know the BGP instance to which a managed MIB node belongs. To resolve this issue, configure different SNMP contexts for different BGP instances.
The device selects a MIB for an SNMP packet according to the context (for SNMPv3) or community name (for SNMPv1/v2c) in the following ways:
· For an SNMPv3 packet:
¡ The device selects the MIB of the BGP instance default if the packet does not carry a context and no SNMP context was configured for the BGP instance default.
¡ The device selects the MIB of a BGP instance if the packet meets the following conditions:
- Carries a context that was configured with the snmp-agent context command in system view.
- Matches the context of the BGP instance.
¡ The device does not process any MIBs in other situations.
· For an SNMPv1/v2c packet:
¡ The device selects the MIB of the BGP instance default if the following conditions are met:
- No SNMP community to SNMP context mapping was configured with the snmp-agent community-map command in system view.
- No SNMP context was configured for the BGP instance default.
¡ The device selects the MIB of a BGP instance if the SNMP community is mapped to an SNMP context and the context matches the context of the BGP instance.
¡ The device does not process any MIBs in other situations.
For more information about SNMP contexts and community names, see Network Management and Monitoring Configuration Guide.
Do not configure the same SNMP context for different BGP instances.
If you execute this command multiple times, the most recent configuration takes effect.
# Configure SNMP context bgp-abc for BGP instance abc.
<Sysname> system-view
[Sysname] bgp 100 instance abc
[Sysname-bgp-abc] snmp context-name bgp-abc
snmp-agent community-map (Network Management and Monitoring Command Reference)
snmp-agent context (Network Management and Monitoring Command Reference)
snmp-agent trap enable bgp
Use snmp-agent trap enable bgp to enable SNMP notifications for BGP.
Use undo snmp-agent trap enable bgp to disable SNMP notifications for BGP.
snmp-agent trap enable bgp [ instance instance-name ]
undo snmp-agent trap enable bgp [ instance instance-name ]
SNMP notifications for BGP are enabled.
network-admin
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 enables SNMP notifications for the default BGP instance.
After you enable SNMP notifications for BGP, the device generates a notification when a BGP neighbor state change occurs. The notification includes the neighbor address, the error code and subcode of the most recent error, and the current neighbor state.
For BGP notifications to be sent correctly, you must also configure SNMP on the device. For more information about SNMP configuration, see the network management and monitoring configuration guide for the device.
# Enable SNMP notifications for BGP.
<Sysname> system-view
[Sysname] snmp-agent trap enable bgp
summary automatic
Use summary automatic to configure automatic route summarization for redistributed IGP subnet routes.
Use undo summary automatic to restore the default.
summary automatic
undo summary automatic
Automatic route summarization is not performed for redistributed IGP subnet routes.
BGP IPv4 unicast address family view
BGP-VPN IPv4 unicast address family view
BGP IPv4 multicast address family view
network-admin
After the summary automatic command is configured, BGP summarizes IGP subnets redistributed by the import-route command.
Automatic summary routes can be manually summarized, but cannot be added to the IP routing table.
# In BGP IPv4 unicast address family view, configure automatic route summarization for redistributed IGP subnet routes.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] summary automatic
aggregate
import-route
timer
Use timer to configure a BGP keepalive interval and hold time.
Use undo timer to restore the default.
timer keepalive keepalive hold holdtime
undo timer
The BGP keepalive interval and the hold time are 60 seconds and 180 seconds, respectively.
BGP-VPN instance view
network-admin
keepalive keepalive: Configures a keepalive interval in the range of 0 to 21845 seconds.
hold holdtime: Configures a hold time in seconds, whose value is 0 or in the range of 3 to 65535. The hold time must be at least three times the keepalive interval.
After establishing a BGP session, two routers send keepalive messages at the specified keepalive interval to each other to keep the session.
If a router receives no keepalive or update message from the peer within the hold time, it tears down the session.
Use the timer command to configure the keepalive interval and hold time for all BGP peers. Use the peer timer command to configure the keepalive interval and hold time for a peer or peer group. If both commands are configured, the intervals configured by the peer timer command have higher priority.
If the hold time settings on the local and peer routers are different, the smaller one is used.
If the hold time is set to 0, no keepalive message will be sent to the peer, and the peer session will never time out. If neither the hold time nor the keepalive interval is set to 0, the actual keepalive interval is the smaller one between one third of the hold time and the keepalive interval.
The timer command affects only new BGP sessions.
After the timer command is executed, no peer session is closed at once. The configured hold time is used for negotiation in session re-establishment (for example, when you reset the BGP session).
# In BGP instance view, set the keepalive interval and hold time to 60 seconds and 180 seconds, respectively.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] timer keepalive 60 hold 180
display bgp peer
peer timer
timer connect-retry
Use timer connect-retry to set the session retry timer for all peers and peer groups.
Use undo timer connect-retry to restore the default.
Syntax
timer connect-retry retry-time
undo timer connect-retry
Default
The session retry timer is 32 seconds for all peers and peer groups.
Views
BGP instance view
BGP-VPN instance view
Predefined user roles
network-admin
Parameters
retry-time: Specifies a session retry timer in the range of 1 to 65535 seconds.
Usage guidelines
To speed up session establishment to a peer or peer group and route convergence, set a small session retry timer. If the BGP session flaps, you can set a large session retry timer to reduce the impact.
The timer set by the peer timer connect-retry command takes precedence over the timer set by the timer connect-retry command.
Examples
# In BGP instance view, set the session retry timer to 30 seconds for all peers.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] timer connect-retry 30
Related commands
peer timer connect-retry
unicast-route recursive-lookup tunnel
Use unicast-route recursive-lookup tunnel to recurse unlabeled public BGP routes to LSPs.
Use undo unicast-route recursive-lookup tunnel to restore the default.
Syntax
In BGP IPv4 unicast address family view:
unicast-route recursive-lookup tunnel [ prefix-list ipv4-prefix-list-name ] [ tunnel-policy tunnel-policy-name ]
undo unicast-route recursive-lookup tunnel
In BGP IPv6 unicast address family view:
unicast-route recursive-lookup tunnel [ prefix-list ipv6-prefix-list-name ] [ tunnel-policy tunnel-policy-name ]
undo unicast-route recursive-lookup tunnel
Default
Unlabeled public BGP routes cannot be recursed to LSPs.
Views
BGP IPv4 unicast address family view
BGP IPv6 unicast address family view
Predefined user roles
network-admin
Parameters
prefix-list ipv4-prefix-list-name: Recurses only unlabeled public BGP routes that match an IPv4 prefix list to LSPs. The ipv4-prefix-list-name argument specifies an IPv4 prefix list by its name, a case-sensitive string of 1 to 63 characters. If you do not specify this option, all unlabeled public BGP routes can be recursed to LSPs.
prefix-list ipv6-prefix-list-name: Recurses only unlabeled public BGP routes that match an IPv6 prefix list to LSPs. The ipv6-prefix-list-name argument specifies an IPv6 prefix list by its name, a case-sensitive string of 1 to 63 characters. If you do not specify this option, all unlabeled public BGP routes can be recursed to LSPs.
tunnel-policy tunnel-policy-name: Recurses unlabeled public BGP routes to only LSPs that match a tunnel policy. The tunnel-policy-name argument specifies a tunnel policy by its name, a case-sensitive string of 1 to 19 characters. If you do not specify this option, an unlabeled public BGP route can be recursed to any LSPs.
Usage guidelines
After you configure this command, unlabeled public BGP routes will be preferentially recursed to LSPs. If a route fails to be recursed to an LSP, the route will be recursed to the IP next hop.
If you execute this command multiple times for an address family, the most recent configuration takes effect.
Examples
# In BGP IPv4 unicast address family view, recurse unlabeled public BGP routes to LSPs.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] unicast-route recursive-lookup tunnel