拓扑

配置
router bgp 65200
bgp log-neighbor-changes
neighbor 10.12.1.1 remote-as 65100
neighbor 10.23.1.2 remote-as 65200
!
address-family ipv4
network 100.100.100.0 mask 255.255.255.0 route-map RM_NONDEFAULT_111
aggregate-address 100.100.100.0 255.255.255.0 route-map RM_NONDEFAULT_333
redistribute static route-map RM_NONDEFAULT_222
neighbor 10.12.1.1 activate
neighbor 10.12.1.1 send-community
neighbor 10.23.1.2 activate
neighbor 10.23.1.2 send-community
exit-address-family
验证优先级
- network
- redistribute
- aggregate-address
- 观察R1 上100.100.100.0 的Community 值

- 然后 no 掉 network,观察 Community 值

- 再no 掉 redistribute 。 此时会发现R1 上收到的路由没有携带 Community值,因为R2 的BGP里除了 redistribute static 这条明细之外,还有1条全局的 redistribute static .
- 将其去掉之后,会发现R1 完全收不到R2 的路由宣告了。因为使用 aggregate-address 成功宣告的前提是BGP路由中有这个明细。我们在 R3 上创建1个100.100.100.1/32 的Lo0,然后network 进 iBGP
