首页/网络/BGP 与广域网速查/标准 Community:格式与打标用法
BGP 选路与策略62 条

标准 Community:格式与打标用法

标准 community 是 32 位可选传递属性,书写为 ASN:值(两段各 0~65535);用于给路由打标签,配合 community-list 与 route-map 做选路与过滤。

BGP 与广域网速查网络更新于 2026-10-12
长度32 位
格式<ASN>:<值>
属性类型可选传递
用途标记来源、角色、客户类型;跨 AS 传递策略语义
发布条件需 send-community 邻居配置

打标与查看

打标与查看
route-map RM-TAG permit 10
 set community 65001:100 additive
!
router bgp 65001
 neighbor 10.0.0.2 send-community
 neighbor 10.0.0.2 route-map RM-TAG out
!
show ip bgp 10.1.1.0/24 | include Community

易错点

  • 忘记 send-community:社区在本机可见但对端收不到
  • 编号随意规划:后续过滤规则互相重叠,难以区分来源与角色

数据来源与参考

  • RFC 1997: BGP Communities Attribute
​‌‌​​‌​​​‌‌​‌‌‌‌​‌‌​​​‌‌​‌‌‌​​‌‌​​‌​‌‌‌​​‌‌‌​​​‌​‌‌​‌​​‌​‌‌‌​​​‌​‌‌​‌​​‌​‌‌​​​‌‌​‌‌‌​‌​​​‌‌​‌‌‌‌​​‌​‌‌‌​​‌‌​​​‌‌​‌‌​‌‌‌‌​‌‌​‌‌​‌