community属性。这是不同于选路属性的一个属性。该属性具有以下几个特点;


1 community是一个任选可透明传送属性,它可以简化策略的执行。


2 它是cisco的一个专有属性,现在在RFC1997中已被标准化。


3 commnity属性标明一个目的地作为一些目的地团体中的一个成员,这些目的地共享一个或多个共同的特性。


4 community值可以自己定义,另外有几个已经定义好的团体属性:


NO_ADVERTISE: 表示携带该值的路由不能公布给EBGP和 IBGP邻居


NO_EXPORT:表示携带该值的路由不能公布给EBGP邻居


LOCAL_AS:(NO_EXPORT_SUBCONFED)携带该值的路由可以公布给联盟内的其它子自治系统但不能在构成联盟的AS以外进行公布。


试验步骤如下:


配置BGP,在本实验中要建立联邦 我们顺便学习一下联邦


配置团体属性,让2.2.2.0网络只被R2学习到


配置团体属性,让22.22.22.0网络只被R2,R3学习到


配置团体属性,让222.222.222.0网络只被R2,R3,R4学习到


配置团体属性,让R1不传递2.2.2.0 这条路由





二 试验配置





配置BGP


r1#sh run | b r b


router bgp 100


 no synchronization


network 2.2.2.0 mask 255.255.255.0


 network 22.22.22.0 mask 255.255.255.0


 network 222.222.222.0


 neighbor 12.0.0.2 remote-as 234


 no auto-summary



r2#sh run | b r b


router bgp 64512


 no synchronization


bgp confederation identifier 234   /指明联邦号是234


 neighbor 12.0.0.1 remote-as 100


 neighbor 23.0.0.3 remote-as 64512  /R3 跟它处于联邦内同一个子 AS 中


 neighbor 23.0.0.3 next-hop-self     / 指定下一跳是它自己


 no auto-summary





r3#sh run | b r b


router bgp 64512


 no synchronization


 bgp confederation identifier 234


 bgp confederation peers 64513      / 指明该联邦内的另一个子 AS


 neighbor 23.0.0.2 remote-as 64512


 neighbor 34.0.0.4 remote-as 64513   /R4 跟它处于联邦内不同子 AS 之间


 no auto-summary





r4#sh run | b r b


router bgp 64513


 no synchronization


 bgp confederation identifier 234


 bgp confederation peers 64512


 neighbor 34.0.0.3 remote-as 64512


 neighbor 45.0.0.5 remote-as 500


 no auto-summary





r5#sh run | b r b


router bgp 500


 no synchronization


 neighbor 45.0.0.4 remote-as 234


 no auto-summary



 
查看网络


r2#sh ip bgp


   Network          Next Hop            Metric LocPrf Weight Path
*> 2.2.2.0/24       12.0.0.1                 0             0 100 i
*> 22.22.22.0/24    12.0.0.1                 0             0 100 i
*> 222.222.222.0    12.0.0.1                 0             0 100 i
r3#sh ip bgp


   Network          Next Hop            Metric LocPrf Weight Path
*>i2.2.2.0/24       23.0.0.2                 0    100      0 100 i
*>i22.22.22.0/24    23.0.0.2                 0    100      0 100 i
*>i222.222.222.0    23.0.0.2                 0    100      0 100 i
在 R2 上已经修改了下一跳,所以这时下一跳已经是 R2 自己了。


r4#sh ip bgp


   Network          Next Hop            Metric LocPrf Weight Path
*  2.2.2.0/24       23.0.0.2                 0    100      0 (64512) 100 i
*  22.22.22.0/24    23.0.0.2                 0    100      0 (64512) 100 i
*  222.222.222.0    23.0.0.2                 0    100      0 (64512) 100 i