可选传递

   - BGP communities是一种给路由条目打上标记,用于确保路由过滤和选择的连续性

   - BGP 路由器可以在重分布、发送、接收路由更新的时候给路由条目打上community值(route-map)

   - 根据 community值,BGP 路由器可以过滤进出路由更新或者优选某些路由

   - 缺省情况下,在update路由的时候community被剥离


    ◆32 bit community balue is split into two parts:

      [AS-number]:[low-order-16-bits]

        AS号       描述本地设备


    ◆配置

        router(config)#

            match condition

            set community value---100:1 // AS100

        router bgp 100

            nei x.x.x.x route-map map in/out

            neit x.x.x.x send-community //community默认不传递,此命令用于传递

        调用community,操作

        router(config)#

            ip community-list 1-99 permit | deny value 


      ◆community-list 标准(1-99):匹配别人打的值

                       扩展(100-199):用正则表达式匹配。

                        

        route-map name permit|deny

            match community clist-number

            set attributes


实验:

wKioL1bQKsewR9ubAAFce-DipyE414.png

AS200配置联邦,R2 R4在AS2000;R5在AS300

R2 R4 R5igp运行ospf

R1&#x