BGP 团体属性过滤器/团体属性列表

学好声韵辩四声 / 2023-05-18 / 原文

 

LSW5转发给LSW6路由时,加上团体属性 no-advertise ,LSW6收到后,对LSW7的出方向应用路由策略,允许 no-advertise 的通过。那么LSW6到底会不会转发给LSW7 ?

 no-advertise    :Do not advertise to any peer (well-known community attributes)

 

试验结果证明:LSW6没有转发给LSW7

LSW5

route-policy r1 permit node 10
 apply community no-advertise
#
interface LoopBack1
 ip address 1.1.1.1 255.255.255.255
#
bgp 100
 peer 10.1.1.2 as-number 100
 #
 ipv4-family unicast
  undo synchronization
  network 1.1.1.1 255.255.255.255
  peer 10.1.1.2 enable
  peer 10.1.1.2 route-policy r1 export
  peer 10.1.1.2 advertise-community
#

 

LSW6

ip community-filter 1 permit no-advertise

#
route-policy r2 permit node 10
 if-match community-filter 1
#

#
bgp 100
 peer 10.1.1.1 as-number 100
 peer 10.1.1.3 as-number 200
 #
 ipv4-family unicast
  undo synchronization
  peer 10.1.1.1 enable
  peer 10.1.1.3 enable
  peer 10.1.1.3 route-policy r2 export
#

 

LSW7

#
bgp 200
 peer 10.1.1.2 as-number 100
 #
 ipv4-family unicast
  undo synchronization
  peer 10.1.1.2 enable
#