Community List
2025/10/29路由对象7.x.x大约 1 分钟
Community List
Community List 使用 Community 字符串过滤/操作 BGP 路由,可以在 Route Map 中使用,匹配在 Community List 中定义的具有特定 Community 属性的路由。
配置方法
规则匹配顺序
- FortiGate 按
config rule下的规则 ID 从小到大匹配COMMUNITY属性,以第一条命中规则的动作为准。即使配置中依次显示10 → 20 → 15,实际检查顺序也是10 → 15 → 20。 - 如果 Route Map 规则通过
match-community引用了 Community List,只有列表返回permit才满足对应的匹配条件。列表返回deny时,FortiGate 继续检查下一条 Route Map 规则。
config router community-list
edit <name>
set type {standard | expanded}
config rule
edit <id>
set action {deny | permit}
set regexp <string>
set match <string>
next
end
next
endtype {standard | expanded}:Community List 的类型:- standard:匹配精确的 Community 字符,通常用于直接过滤 Community 精确字符。
- expanded:基于正则表达式进行匹配。在处理较多的 Community 时,非常有用。
action {deny | permit}:action 的 permit/deny 表示匹配/不匹配。regexp <string>:使用正则表达式匹配 Community List,type配置为expanded时可用。match <string>:使用完整 Community 字符方式匹配 Community List,type配置为standard时可用。
引用 Community List
被 Route Map 引用
config router route-map
edit <name>
config rule
edit <id>
set match-community <string>
next
end
next
endmatch-community <string>:匹配 BGP 路由中的 community 属性。