一、实验思路及拓扑
1、在BGP的可选非过渡属性中有两个属性:Aggregator和Preferred-Value,本实验主要对上述两个属性进行验证和说明
2、Aggregator:对接收的路由进行汇总,并可通过detail-suppressed命令仅发布汇总路由抑制明细路由的发送;
3、Preferred-Value:对接收的路由进行调整,值越大越优,只对本设备有效,不会发布到其他设备,非常适合于仅在本路由设备优选路由的情况
四个路由器分别位于1、2、3、4四个BGP区域
二、基础配置
(一)如图所示配置接口地址(此处省略)
(二)如图所示配置BGP(此处省略)
三、详细配置
(一)Aggregator设置
bgp 3
router-id 3.3.3.3
peer 10.1.13.1 as-number 1
peer 10.1.23.2 as-number 2
peer 10.1.34.4 as-number 4
#
ipv4-family unicast
undo synchronization
aggregate 172.16.0.0 255.255.0.0
peer 10.1.13.1 enable
peer 10.1.23.2 enable
peer 10.1.34.4 enable
配置隐藏明细路由功能
[R3-bgp]aggregate 172.16.0.0 16 detail-suppressed
(二)Preferred-Value设置
#
ip ip-prefix 1 index 10 permit 172.16.1.1 32
ip ip-prefix 2 index 10 permit 172.16.2.2 32
#
#
route-policy R1 permit node 10
if-match ip-prefix 1
apply preferred-value 111
#
route-policy R2 permit node 20
if-match ip-prefix 2
apply preferred-value 222
#
#
bgp 3
router-id 3.3.3.3
peer 10.1.13.1 as-number 1
peer 10.1.23.2 as-number 2
peer 10.1.34.4 as-number 4
#
ipv4-family unicast
undo synchronization
aggregate 172.16.0.0 255.255.0.0 detail-suppressed
peer 10.1.13.1 enable
peer 10.1.13.1 route-policy R1 import
peer 10.1.23.2 enable
peer 10.1.23.2 route-policy R2 import
peer 10.1.34.4 enable
#
四、结果验证
(一)Aggregator设置结果情况
<R4>dis bgp routing-table
BGP Local router ID is 10.1.34.4
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 3
Network NextHop MED LocPrf PrefVal Path/Ogn
*> 172.16.0.0 10.1.34.3 0 3i
*> 172.16.1.1/32 10.1.34.3 0 3 1i
*> 172.16.2.2/32 10.1.34.3 0 3 2i
<R4>dis bgp routing-table
BGP Local router ID is 10.1.34.4
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 1
Network NextHop MED LocPrf PrefVal Path/Ogn
*> 172.16.0.0 10.1.34.3 0 3i
<R4>dis bgp routing-table 172.16.0.0
BGP local router ID : 10.1.34.4
Local AS number : 4
Paths: 1 available, 1 best, 1 select
BGP routing table entry information of 172.16.0.0/16:
From: 10.1.34.3 (3.3.3.3)
Route Duration: 00h02m51s
Direct Out-interface: GigabitEthernet0/0/0
Original nexthop: 10.1.34.3
Qos information : 0x0
AS-path 3, origin igp, pref-val 0, valid, external, best, select, active, pre 2
55
Aggregator: AS 3, Aggregator ID 3.3.3.3, Atomic-aggregate
Not advertised to any peer yet
(二)Preferred-Value设置结果情况
[R3]dis bgp routing-table
BGP Local router ID is 3.3.3.3
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 3
Network NextHop MED LocPrf PrefVal Path/Ogn
*> 172.16.0.0 127.0.0.1 0 i
s> 172.16.1.1/32 10.1.13.1 0 111 1i
s> 172.16.2.2/32 10.1.23.2 0 222 2i