BGPcommunity属性相关操作

BGP Communities

  1. BGP communities是一种路由标记方法,用于确保路由过滤和选择的连续性 
  2. 可选传递属性,不支持该属性的BGP router原封不动的将community值传递给下游BGP邻居 

为路由前缀分配Community

BGPcommunity属性相关操作_第1张图片

R1
 neighbor 10.1.12.2 send-community
 neighbor 10.1.12.2 route-map 1 out
route-map 1 permit 10
 match ip address prefix-list 1
 set community 6553611
ip prefix-list 1 seq 5 permit 11.11.11.0/24

为路由前缀分配多个Community

 还是上面那张图,在R2上给11.11.11.0/24这条路由添加no-export属性

//R2
ip community-list 11 permit 100:11 
 neighbor 10.1.23.3 route-map 1 out
route-map 1 permit 10
 match community 11
 set community no-export additive

用community-list匹配团体属性

lp community-list 1 permit 100:11

匹配。匹配community中包含100:11的路由

lp community-list 1 permit 100:11 no-adv

不匹配。要求100:11及no-adv两者都有才匹配成立

lp community-list 1 permit 100:11

lp community-list 1 permit no-export( 或将no-export换成no-adv )

匹配。只要community中包含100:11或no-export

ip community-list 12 permit internet

默认所有路由都属于internet

lp community-list 11 permit no-export

route-map test permit 10
match community 11 exact-match        //严格匹配

严格匹配community属性为no-export的路由,多一点,少一点都不行

删除某个或多个community值 

ip community-list standard del permit no-export        //匹配要删除的commu值
route-map test permit 10
set comm-list del delete        //用这条命令删除

//删除多个就写多行,一行写多个值不生效

配置community-list

lp community-list 1-99 permit|deny value [value...]
定义标准的community-list,使用internet关键字匹配任何community
lp community-list 100-199 permit|deny regexp
定义扩展的community-list,可使用正则表达式匹配community
show ip community-list 
查看配置的community-list 
show ip bgp x.X.X.X 
查看BGP路由的详细信息,包括community

 

你可能感兴趣的:(#,BGP,网络)