50、BGP配置实验之社团属性community

1、社团属性community解析

wKioL1ZtYLaQ_uOlAABm5SPyRW4379.png

BGP社团属性community:

可开启:BGP社团属性community为可选属性,默认不识别。可通过命令开启:neighbor x.x.x.x send-community

传递性:BGP社团属性community只在邻居有效,邻居的邻居不再有效,想要传递到邻居的邻居需配置neighbor x.x.x.x send-community


修改BGP社团属性community步骤:


ip prefix-list 1 permit 1.1.1.0/24

route-map COM permit 10

 match ip address prefix-list 1

 set community no-advertise 不传给BGP邻居

 set community no-export不传出大AS

 set community local-AS 不传出小AS

route-map COM permit 20

router bgp 1

 neighbor 12.1.1.2 send-community

 neighbor 12.1.1.2 route-map COM out


2、实验拓扑

wKiom1ZtYTnSR2ZxAABRAUFLou4631.png

3、基础配置

R1配置

interface Loopback0

 ip address 1.1.1.1 255.255.255.0

interface Serial0/0

 ip address 12.1.1.1 255.255.255.0

router bgp 1

 no synchronization

 bgp router-id 1.1.1.1

 network 1.1.1.0 mask 255.255.255.0

 neighbor 12.1.1.2 remote-as 2

 neighbor 12.1.1.2 send-community

 no auto-summary


R2配置

interface Loopback0

 ip address 2.2.2.2 255.255.255.0

interface Serial0/0

 ip address 12.1.1.2 255.255.255.0

interface Serial0/1

 ip address 23.1.1.2 255.255.255.0

router ospf 110

 router-id 2.2.2.2

 network 2.2.2.0 0.0.0.255 area 0

 network 23.1.1.0 0.0.0.255 area 0

router bgp 64512

 no synchronization

 bgp router-id 2.2.2.2

 bgp confederation identifier 2

 neighbor 3.3.3.3 remote-as 64512

 neighbor 3.3.3.3 update-source Loopback0

 neighbor 3.3.3.3 next-hop-self

 neighbor 12.1.1.1 remote-as 1

 neighbor 3.3.3.3 send-community

 no auto-summary


R3配置

interface Loopback0

 ip address 3.3.3.3 255.255.255.0

interface Serial0/0

 ip address 34.1.1.3 255.255.255.0

interface Serial0/1

 ip address 23.1.1.3 255.255.255.0

router ospf 110

 router-id 3.3.3.3

 network 3.3.3.0 0.0.0.255 area 0

 network 23.1.1.0 0.0.0.255 area 0

 network 34.1.1.0 0.0.0.255 area 0

router bgp 64512

 no synchronization

 bgp router-id 3.3.3.3

 bgp confederation identifier 2

 bgp confederation peers 64513 

 neighbor 2.2.2.2 remote-as 64512

 neighbor 2.2.2.2 update-source Loopback0

 neighbor 4.4.4.4 remote-as 64513

 neighbor 4.4.4.4 ebgp-multihop 255

 neighbor 4.4.4.4 update-source Loopback0

 neighbor 4.4.4.4 send-community 

 no auto-summary


R4配置

interface Loopback0

 ip address 4.4.4.4 255.255.255.0

interface Serial0/0

 ip address 34.1.1.4 255.255.255.0

interface Serial0/1

 ip address 45.1.1.4 255.255.255.0

router ospf 110

 router-id 4.4.4.4

 network 4.4.4.0 0.0.0.255 area 0

 network 34.1.1.0 0.0.0.255 area 0

 network 45.1.1.0 0.0.0.255 area 0

router bgp 64513

 no synchronization

 bgp router-id 4.4.4.4

 bgp confederation identifier 2

 bgp confederation peers 64512 

 neighbor 3.3.3.3 remote-as 64512

 neighbor 3.3.3.3 ebgp-multihop 255

 neighbor 3.3.3.3 update-source Loopback0

 neighbor 5.5.5.5 remote-as 64513

 neighbor 5.5.5.5 update-source Loopback0

 neighbor 5.5.5.5 send-community 

 no auto-summary


R5配置

interface Loopback0

 ip address 5.5.5.5 255.255.255.0

interface Serial0/0

 ip address 56.1.1.5 255.255.255.0

interface Serial0/1

 ip address 45.1.1.5 255.255.255.0

router ospf 110

 router-id 5.5.5.5

 network 5.5.5.0 0.0.0.255 area 0

 network 45.1.1.0 0.0.0.255 area 0

router bgp 64513

 no synchronization

 bgp router-id 5.5.5.5

 bgp confederation identifier 2

 neighbor 4.4.4.4 remote-as 64513

 neighbor 4.4.4.4 update-source Loopback0

 neighbor 56.1.1.6 remote-as 6

 neighbor 56.1.1.6 send-community 

 no auto-summary


R6配置

interface Loopback0

 ip address 6.6.6.6 255.255.255.0

interface Serial0/0

 ip address 56.1.1.6 255.255.255.0

router bgp 6

 no synchronization

 bgp router-id 6.6.6.6

 neighbor 56.1.1.5 remote-as 2

 no auto-summary


4、社团属性验证

wKioL1ZtYLaQ_uOlAABm5SPyRW4379.png


ip prefix-list 1 seq 5 permit 1.1.1.0/24

route-map COM permit 10

 match ip address prefix-list 1

 set community no-advertise

route-map COM permit 20

router bgp 1

 neighbor 12.1.1.2 send-community

 neighbor 12.1.1.2 route-map COM out


wKiom1ZtZeXgzZPtAAAVpDkptrw125.png

wKioL1ZtZeqiPFzAAAANW0ZgfwA681.png

ip prefix-list 1 seq 5 permit 1.1.1.0/24

route-map COM permit 10

 match ip address prefix-list 1

 set community no-export

route-map COM permit 20

router bgp 1

 neighbor 12.1.1.2 send-community

 neighbor 12.1.1.2 route-map COM out

wKioL1Ztjl-xGWa9AAAUuiMMdkM643.png

wKioL1ZtjmDDBXFpAAAK540p-tc573.png

ip prefix-list 1 seq 5 permit 1.1.1.0/24

route-map COM permit 10

 match ip address prefix-list 1

 set community local-AS

route-map COM permit 20

router bgp 1

 neighbor 12.1.1.2 send-community

 neighbor 12.1.1.2 route-map COM out

wKiom1ZtjwGyZkY6AAATd_vZlvk427.png

wKioL1ZtjwbwRO60AAALGukMTNw566.png






      本文转自开源殿堂 51CTO博客,原文链接:http://blog.51cto.com/kaiyuandiantang/1722619,如需转载请自行联系原作者




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值