
add_asn.
if-match ip-prefix prefix1 //Configure IP prefix list
named prefix1.
apply as-path 65003 65003 65003 additive //Add 65003, 65003, 65003
to the AS_Path of the route that matches prefix1.
#
route-policy add_asn permit node 20 //Define the second node of
add_asn to permit all other routes.
#
ip ip-prefix prefix1 index 10 permit 172.16.1.0 24 //Define the first index of
prefix1 to match the route 172.16.1.0/24.
ip ip-prefix prefix1 index 20 permit 172.16.2.0 24 //Define the second index
of prefix1 to match the route 172.16.2.0/24.
ip ip-prefix prefix1 index 30 permit 172.16.3.0 24 //Define the third index of
prefix1 to match the route 172.16.3.0/24.
#
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.1.2 0 65002 65004
65005?
* 10.1.3.2 0 65003 65003
65003 65003 65005?
*> 172.16.2.0/24 10.1.1.2 0 65002 65004
65005?
* 10.1.3.2 0 65003 65003
65003 65003 65005?
*> 172.16.3.0/24 10.1.1.2 0 65002 65004
65005?
* 10.1.3.2 0 65003 65003
65003 65003 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.1.2 (10.1.1.2)
Route Duration: 00h33m30s
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,
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.3.2 (10.1.5.1)
Route Duration: 00h02m12s
Direct Out-interface: GigabitEthernet0/0/0
Original nexthop: 10.1.3.2
Qos information : 0x0
AS-path 65003 65003 65003 65003 65005
, origin incomplete, pref-val 0, valid,
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.
932