display bgp routing-table ipv4 unicast

Use display bgp routing-table ipv4 unicast to display BGP IPv4 unicast routing information.

Syntax

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 ]

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 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.

Usage guidelines

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.

Examples

# Display brief information about all BGP IPv4 unicast routes.

<Sysname> display bgp routing-table ipv4

 Total number of routes: 4

 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
               a – additional-path
               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       200i
* >  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

 Total number of routes: 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
               a – additional-path
               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

 Total number of routes: 2

 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
               a – additional-path
               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

 Total number of routes: 2

 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
               a – additional-path
               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

Table 103: Command output

Field

Description

Status codes

Status codes:

  • * – valid—Valid route.

  • > – best—Optimal route.

  • d – dampened—Dampened route.

  • h – history—History route.

  • s – suppressed—Suppressed route.

  • S stale—Stale route.

  • i – internal—Internal route.

  • e – external—External route.

  • a additional-path—Add-Path optimal route.

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.

  • 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

 Paths:   2 available, 1 best

 BGP routing table information of 10.2.1.0/24:
 Imported route.
 Original nexthop: 10.2.1.1
 OutLabel        : NULL
 RxPathID        : 0x0
 TxPathID        : 0x0
 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

 From            : 10.2.1.2 (192.168.100.2)
 Rely nexthop   : not resolved
 Original nexthop: 10.2.1.2
 OutLabel        : NULL
 RxPathID        : 0x0
 TxPathID        : 0x0
 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

# 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

 Paths:   2 available, 1 best

 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
 RxPathID        : 0x0
 TxPathID        : 0x0
 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


 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
 RxPathID        : 0x0
 TxPathID        : 0x0
 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

Table 104: 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

This field is not supported in the current software version.

Outgoing label of the route.

RxPathID

Add-path ID of received routes.

TxPathID

Add-path ID of advertised routes.

AS-path

AS_PATH attribute of the route, which records the ASs the route has passed and avoids routing loops.

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 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.

# 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

 Advertised routes total: 2

# 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

 Received routes total: 2

Table 105: 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

 Total number of routes: 4

Table 106: 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

 Paths:   1 best

 BGP routing table information of 10.2.1.0/24(TxPathID:0):
 Advertised to peers (1 in total):
    10.2.1.2

Table 107: 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(TxPathID:0)

Advertisement information for network 10.2.1.0/24.

Advertised to peers (1 in total)

Peers to which the network has been advertised.

Related commands

ip as-path

ip community-list