The display bgp routing-table command displays information about BGP routes. Information about specified routes can be displayed by specifying different parameters.
display bgp routing-table [ verbose | ipv4-address [ { mask | mask-length } [ longer-prefixes ] ] ]
display bgp routing-table [ as-path-filter { as-path-filter-number | as-path-filter-name } | cidr | different-origin-as ]
display bgp routing-table regular-expression as-regular-expression
display bgp routing-table community-filter { { community-filter-name | basic-community-filter-number } [ whole-match ] | advanced-community-filter-number }
display bgp routing-table community [ community-number | aa:nn ] &<1-29> [ internet | no-advertise | no-export | no-export-subconfed ] * [ whole-match ]
display bgp routing-table peer ipv4-address received-routes ipv4-address [ { mask | mask-length } [ longer-prefixes | original-attributes ] ]
display bgp routing-table peer ipv4-address { advertised-routes [ ipv4-address [ { mask | mask-length } [ longer-prefixes ] ] ] | received-routes [ active ] }
display bgp routing-table peer ipv4-address accepted-routes
display bgp routing-table time-range start-time end-time
Parameter | Description | Value |
---|---|---|
verbose | Displays detailed information about BGP public network routes. |
- |
ipv4-address | Specifies an IPv4 network address. | The value is in dotted decimal notation. |
mask | mask-length | Specifies a mask in dotted decimal notation or the mask length. | - |
longer-prefixes | Matches any route whose prefix mask is longer than the specified length. | - |
as-path-filter | Displays the routes that match a specified filter. | - |
as-path-filter-number | Specifies the number of the matching AS-Path filter. | It is an integer that ranges from 1 to 256. |
as-path-filter-name | Specifies the name of the matching AS-Path filter. | The name is a string of 1 to 51 characters without any space. It is case-sensitive. |
cidr | Displays Classless InterDomain Routing (CIDR) information. | - |
regular-expression as-regular-expression | Specifies the regular expression used to match the AS_Path information. | The value is a string of 1 to 80 characters. |
different-origin-as | Displays routes that have the same destination address but different source AS numbers. | - |
community-filter | Displays the routes that match a specified BGP community filter. | - |
community-filter-name | Specifies the name of a community filter. | The name is a string of 1 to 51 characters. The string cannot be all numbers. |
basic-community-filter-number | Specifies the number of a basic community filter. | The value is an integer that ranges from 1 to 99. |
advanced-community-filter-number | Specifies the number of an advanced community filter. | The value is an integer that ranges from 100 to 199. |
community | Displays the routes carrying the specified BGP community attribute in the routing table. | - |
community-number | Specifies the community number. | - |
aa:nn: | Specifies the community number. | - |
internet | Displays the matching routes that can be sent to any peer. | - |
no-advertise | Displays the BGP routes carrying the No-Advertise community attribute. | - |
no-export | Displays the BGP routes carrying the No-Export community attribute. | - |
no-export-subconfed | Displays the BGP routes carrying the No-Export-Subconfed community attribute. | - |
whole-match | Indicates exact matching. | - |
peer ipv4-address | Displays routes of a specified peer. | - |
advertised-routes | Displays the routes advertised to a specified peer. | - |
received-routes | Displays the routes received from a specified peer. | - |
active | Displays the active routes received from a specified peer. | - |
original-attributes | Displays the original attributes of a public route from a specified BGP peer before the route is filtered by the local import policy. To display such attributes, the peer keep-all-routes command must have been run. | - |
accepted-routes | Displays the routes that are received from the peer and filtered through a routing policy. | - |
time-range start-time end-time | Displays BGP routes that flap within the specified time period. For example, the value 0d0h5m0s of start-time indicates five minutes before the current time. The value 0d0h10m0s of end-time indicates 10 minutes before the current time. All BGP routes with the Keepalive time in the range of 5 to 10 minutes are displayed. | The value ranges of start-time and end-time both are 0d0h0m0s-10000d23h59m59s. |
Usage Scenario
Information about specified routes can be displayed by specifying different parameters.
The display bgp routing-table command is used to display active and inactive BGP routes on the public network.
# Display all BGP routing information.
<HUAWEI> display bgp routing-table
BGP Local router ID is 10.1.1.2 Status codes: * - valid, > - best, d - damped, h - history, i - internal, s - suppressed, S - Stale Origin : i - IGP, e - EGP, ? - incomplete Total Number of Routes: 4 Network NextHop MED LocPrf PrefVal Path/Ogn * 10.1.1.0/24 10.1.1.1 0 0 100? * 10.1.1.2/32 10.1.1.1 0 0 100? *> 10.1.1.0/24 10.1.1.1 0 0 100? *> 10.1.1.0/24 10.1.1.1 0 0 100?
# Display routes with the community attribute.
<HUAWEI> display bgp routing-table community
BGP Local router ID is 10.1.1.2 Status codes: * - valid, > - best, d - damped, h - history, i - internal, s - suppressed, S - Stale Origin : i - IGP, e - EGP, ? - incomplete Total Number of Routes: 4 Network NextHop MED LocPrf PrefVal Community * 10.1.1.0/24 10.1.1.1 0 0 no-export * 10.1.1.2/32 10.1.1.1 0 0 no-export *> 10.1.1.0/24 10.1.1.1 0 0 no-export *> 10.1.1.0/24 10.1.1.1 0 0 no-export
Item |
Description |
---|---|
BGP Local router ID |
Indicates the router ID of the local BGP device. |
Network |
Indicates the network address in the BGP routing table. |
NextHop |
Indicates the next-hop address for the packet. |
MED |
Indicates the MED of the route. |
LocPrf |
Indicates the local preference. |
PrefVal |
Indicates the preferred value. |
Path/Ogn |
Indicates the AS_Path number and the origin attribute. |
Community |
Indicates the community attribute information. |
# Display the detailed information of the specified routes.
<HUAWEI> display bgp routing-table 10.1.1.0
BGP local router ID : 10.1.2.2 Local AS number : 65002 Paths: 2 available, 1 best, 1 select BGP routing table entry information of 10.1.1.0/24: From: 10.1.2.1 (10.1.1.1) Route Duration: 00h04m37s Direct Out-interface: Vlanif10 Original nexthop: 10.1.2.1 Qos information : 0x0 AS-path 65001, origin incomplete, MED 0, pref-val 0, valid, external, best, select, active, pre 255 Advertised to such 2 peers: 10.1.2.1 10.1.3.1 BGP routing table entry information of 10.1.1.0/24: From: 10.1.3.1 (10.1.1.2) Route Duration: 00h04m10s Direct Out-interface: Vlanif20 Original nexthop: 10.1.3.1 Qos information : 0x0 AS-path 65001, origin incomplete, MED 0, pref-val 0, valid, external, backup, pre 255, not preferred for router ID Not advertised to any peer yet
# Display detailed information about all BGP routes.
<HUAWEI> display bgp routing-table verbose
BGP local router ID : 10.1.2.2 Local AS number : 100 Total Number of Routes: 2 Paths: 1 available, 1 best, 1 select BGP routing table entry information of 10.1.1.1/32: From: 10.1.2.1 (10.1.1.1) Route Duration: 21h57m52s Relay IP Nexthop: 0.0.0.0 Relay IP Out-Interface: Vlanif10 Original nexthop: 10.1.2.1 Qos information : 0x0 AS-path Nil, origin incomplete, MED 0, localpref 100, pref-val 0, valid, internal, best, select, active, pre 255 Advertised to such 1 peers: 10.1.2.1 Paths: 1 available, 1 best, 1 select BGP routing table entry information of 10.2.2.2/32: From: 10.3.1.2 (10.2.2.2) Route Duration: 21h57m52s Relay IP Nexthop: 0.0.0.0 Relay IP Out-Interface: Vlanif20 Original nexthop: 10.3.1.2 Qos information : 0x0 AS-path Nil, origin incomplete, MED 0, localpref 100, pref-val 0, valid, internal, best, select, active, pre 255 Advertised to such 1 peers: 10.3.1.2
<HUAWEI> display bgp routing-table 192.168.1.1
BGP local router ID : 10.1.1.1 Local AS number : 100 Paths: 2 available, 0 best, 0 select BGP routing table entry information of 192.168.1.1/32: From: 10.1.1.2 (10.1.1.2) Route Duration: 00h01m31s Relay IP Nexthop: 0.0.0.0 Relay IP Out-Interface: Original nexthop: 172.16.1.2 Qos information : 0x0 AS-path 200, origin incomplete, MED 0, localpref 100, pref-val 0, internal, pre 255, invalid for IP unreachable Not advertised to any peer yet
Item |
Description |
---|---|
BGP local router ID |
ID of the local BGP device. The format is the same as the IPv4 address. |
Local AS number |
Local AS number |
Total Number of Routes |
Total number of BGP routes. |
Paths |
Indicates the route selection result |
BGP routing table entry information of |
Routing entry information |
From |
IP address of an advertising device |
Route Duration |
Route duration |
Relay IP Nexthop |
IP iterated next hop. |
Relay IP Out-Interface |
IP iterated outbound interface. |
Direct Out-interface |
Indicates the directly-connected outbound interface |
Original nexthop |
Original next hop NOTE:
If no routes to the BGP original next hop are available in the IP routing table, BGP routes cannot be advertised. In this case, find out why there is no route to the original next hop (this fault is generally associated with IGP or static routes). |
Qos information |
QoS information.
|
AS-path |
AS_Path attribute Nil indicates that the attribute value is null. |
origin |
Origin attribute of a BGP route:
|
MED |
Multi-Exit discriminator of route. |
localpref |
Local priority. |
pref-val |
Value preferred by the protocol. |
valid |
Valid route |
internal |
Internal route |
external |
External route |
backup |
Backup route. It will be displayed only after the FRR function is enabled. |
best |
Optimal route |
select |
Preferred route |
active |
Active route |
pre |
BGP route preference |
route-select delaying |
The route is in the delayed route selection state. This field is displayed if the route-select delay command has been run, and there are routes delayed to be selected. |
Not advertised to any peer yet |
The BGP route has not been advertised to any peer yet. |
Advertised to such 1 peers |
The BGP route is advertised to the following peer. |
not preferred for router ID |
The route
is not selected as the optimal route because of the router ID of the
advertiser. The following rules are used when selecting an optimal
route:
|
invalid for IP unreachable |
Reason why a route is invalid:
|
Item |
Description |
---|---|
BGP local router ID |
ID of the local BGP device. The format is the same as the IPv4 address. |
Local AS number |
Local AS number. |
Paths |
Information about paths of BGP routes |
BGP routing table entry information of 192.168.1.1/32 |
The following information is about 192.168.1.1/32 routing entries. |
From |
IP address of the router that sends the route. |
Route Duration |
Duration of routes. |
Relay IP Nexthop |
IP iterated next hop. |
Relay IP Out-Interface |
IP iterated outbound interface. |
Original nexthop |
Original next hop. |
Qos information |
QoS information.
|
AS-path 200 |
AS_Path attribute. |
origin incomplete |
Well-known mandatory property. This property defines the
origin of a path and records how a route turns to a BGP route. The
property has the following three values:
|
MED |
Multi-Exit discriminator of route. |
localpref |
Local priority. |
pref-val |
Value preferred by the protocol. |
internal |
The BGP route is an internal route. |
pre 255 |
The BGP route preference is 255. |
invalid for IP unreachable |
Reason why a route is invalid:
|
Not advertised to any peer yet |
The BGP route has not been advertised to any peer yet. |