Run the
display bgp routing-table
[
ip-address
] command to check the configurations.
# Display the routing table of Router A.
[RouterA]
display bgp routing-table
BGP Local router ID is 10.1.1.1
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 6
Network NextHop MED LocPrf PrefVal Path/Ogn
*> 172.16.1.0/24 10.1.3.2 0 65003 65005?
* 10.1.1.2 0 65002 65004
65005?
*> 172.16.2.0/24 10.1.3.2 0 65003 65005?
* 10.1.1.2 0 65002 65004
65005?
*> 172.16.3.0/24 10.1.3.2 0 65003 65005?
* 10.1.1.2 0 65002 65004
65005?
[RouterA]
display bgp routing-table 172.16.1.0
BGP local router ID : 10.1.1.1
Local AS number : 65001
Paths: 2 available, 1 best, 1 select
BGP routing table entry information of 172.16.1.0/24:
From: 10.1.3.2 (10.1.5.1)
Route Duration: 00h00m56s
Direct Out-interface: GigabitEthernet0/0/0
Original nexthop: 10.1.3.2
Qos information : 0x0
AS-path 65003 65005
, origin incomplete, pref-val 0, valid, external,
best
, select,
active, pre 255
Advertised to such 2 peers:
10.1.3.2
10.1.1.2
BGP routing table entry information of 172.16.1.0/24:
From: 10.1.1.2 (10.1.1.2)
Route Duration: 00h34m43s
Direct Out-interface: GigabitEthernet0/0/1
Original nexthop: 10.1.1.2
Qos information : 0x0
AS-path 65002 65004 65005
, origin incomplete, pref-val 0, valid, external, pre
255,
not preferred for AS-Path
Not advertised to any peer yet
The preceding command output shows that Router A selects the route learned from Router C
because this route has a shorter AS_Path length than that learned from Router B. To enable
Router A to select the route learned from Router B, configure Router B to reduce the AS_Path
length of the route or configure Router C to increase the AS_Path length of the route. In the
following example, Router C is configured to increase the AS_Path length of the route. The
detailed configurations on Router C are as follows:
#
bgp 65003
#
ipv4-family unicast
undo synchronization
peer 10.1.3.1 route-policy add_asn export //Apply export policy named
add_asn to routes to be advertised to 10.1.3.1.
#
route-policy add_asn permit node 10 //Define the first node of
HUAWEI NetEngine80E/40E Router
Configuration Guide - IP Routing
8 BGP Configuration
Issue 02 (2014-09-30)
Huawei Proprietary and Confidential
Copyright © Huawei Technologies Co., Ltd.
931