![图片[1]-5.4 BGP团体属性-大赛人网](https://www.dsrw.com/wp-content/uploads/2023/03/图片30-8-1024x545.png)
1.R1配置团体属性no-export-subconfed,携带该值的路由不能公布给任何EBGP对等体,包括联邦内的EBGP邻居
1)R6配置策略,传递no-export-subconfed属性
[R6]interface LoopBack 1
[R6-LoopBack1]ip address 66.66.66.66 32
[R6]bgp 600
[R6-bgp]network 66.66.66.66 32
[R6]ip ip-prefix R6 permit 66.66.66.66 32
[R6]route-policy R6COMM permit node 10
[R6-route-policy]if-match ip-prefix R6
[R6-route-policy]apply community no-export-subconfed
[R6-route-policy]quit
[R6]route-policy R6COMM permit node 20
[R6]bgp 600
[R6-bgp]peer 16.1.1.1 advertise-community
//开启传递团体属性能力
[R6-bgp]peer 16.1.1.1 route-policy R6COMM export
2)R1查看66.66.66.66/32详细BGP路由信息,查看Community:no-export-subconfed属性
<R1>display bgp routing-table 66.66.66.66
BGP local router ID : 1.1.1.1
Local AS number : 65001
Paths: 1 available, 1 best, 1 select
BGP routing table entry information of 66.66.66.66/32:
From: 16.1.1.6 (6.6.6.6)
Route Duration: 00h00m01s
Direct Out-interface: GigabitEthernet0/0/2
Original nexthop: 16.1.1.6
Qos information : 0x0
Community:no-export-subconfed
AS-path 600, origin igp, MED 0, pref-val 0, valid, external, best, select, active, pre 255
Advertised to such 1 peers:
5.5.5.5
3)R2查看BGP路由信息,查看Community:no-export-subconfed属性,不会传递此属性
<R2>display bgp routing-table
*>i 6.6.6.6/32 1.1.1.1 0 200 0 (65001) 600i
4)R5查看BGP路由信息,查看Community:no-export-subconfed属性,会传递此属性
<R5>display bgp routing-table
*>i 6.6.6.6/32 1.1.1.1 0 200 0 600i
*>i 66.66.66.66/32 1.1.1.1 0 200 0 600i
2.R1配置团体属性no-advertise,携带该值的路由不能公布给EBGP和IBGP
1)R6配置策略,传递no-advertise属性
[R6]interface LoopBack 2
[R6-LoopBack2]IP address 6.6.1.1 32
[R6]ip ip-prefix R61 permit 6.6.1.1 32
[R6]route-policy R61COMM permit node 15
[R6-route-policy]if-match ip-prefix R61
[R6-route-policy]apply community no-advertise
[R6-route-policy]quit
[R6]route-policy R61COMM permit node 20
[R6]bgp 600
[R6-bgp]network 6.6.1.1 32
[R6-route-policy]peer 16.1.1.1 route-policy R61COMM export
2)R1查看BGP信息,查看 Community:no-advertise属性
<R1>display bgp routing-table 6.6.1.1
BGP local router ID : 1.1.1.1
Local AS number : 65001
Paths: 1 available, 1 best, 1 select
BGP routing table entry information of 6.6.1.1/32:
From: 16.1.1.6 (6.6.6.6)
Route Duration: 00h02m44s
Direct Out-interface: GigabitEthernet0/0/2
Original nexthop: 16.1.1.6
Qos information : 0x0
Community:no-advertise
AS-path 600, origin igp, MED 0, pref-val 0, valid, external, best, select, active, pre 255
Not advertised to any peer yet
3)R2、R5查看BGP路由信息,携带该值的路由6.6.1.1/32不会通告给任何BGP邻居
<R2>display bgp routing-table
*>i 6.6.6.6/32 1.1.1.1 0 200 0 (65001) 600i
*>i 66.66.66.66/32 1.1.1.1 0 200 0 (65001) 600i
<R5>display bgp routing-table
*>i 6.6.6.6/32 1.1.1.1 0 200 0 600i
*>i 66.66.66.66/32 1.1.1.1 0 200 0 600i
3.R1配置团体属性no-export,携带该值的路由不能公布给真正的EBGP
1)R1配置策略,传递no-export属性
[R1]interface LoopBack 1
[R1-LoopBack3]ip address 1.1.2.1 32
[R1]route-policy R1 permit node 10
[R1-route-policy]apply community no-export
[R1-route-policy]quit
[R1]bgp 65001
[R1-bgp]network 1.1.2.1 32 route-policy R1
2)R1查看BGP路由, 查看Community:no-export属性
[R1]display bgp routing-table 1.1.2.1
BGP local router ID : 1.1.1.1
Local AS number : 65001
Paths: 1 available, 1 best, 1 select
BGP routing table entry information of 1.1.2.1/32:
Network route.
From: 0.0.0.0 (0.0.0.0)
Route Duration: 00h00m52s
Direct Out-interface: InLoopBack0
Original nexthop: 127.0.0.1
Qos information : 0x0
Community:no-export
AS-path Nil, origin igp, MED 0, pref-val 0, valid, local, best, select, pre 0
Advertised to such 2 peers:
2.2.2.2
5.5.5.5
3)R2、R5、R6查看BGP信息,no-export属性在大AS内传递(R2、R5),没有传递给R6
<R2>display bgp routing-table
*>i 1.1.2.1/32 1.1.1.1 0 200 0 (65001)i
<R5>display bgp routing-table
*>i 1.1.2.1/32 1.1.1.1 0 200 0 i
<R6>display bgp routing-table
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
请登录后查看评论内容