image

客户A的两个站点位于不同的地理位置,但是AS号码相同,所以使用了allowas-in特性,但又引发了另一个问题,

就是R1和R2收到了R3发给自己的路由中包含自己的路由,形成了环路。

image

image

可以使用SoO特性解决这一问题,当启用SoO的PE路由器收到相同的SoO值的BGP更新时,将不会发送此更新给对等体

 

配置:

R2:

ip vrf A
rd 100:1
route-target export 100:1
route-target import 100:1
!
interface Loopback0
ip address 3.3.3.3 255.255.255.255
!
interface FastEthernet0/0
ip vrf forwarding A
ip address 13.13.13.3 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet1/0
ip vrf forwarding A
ip address 23.23.23.3 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet2/0
ip address 34.34.34.3 255.255.255.0
duplex auto
speed auto
mpls ip
!
router eigrp 1
network 3.3.3.3 0.0.0.0
network 34.34.34.3 0.0.0.0
no auto-summary
!
router bgp 1
no synchronization
bgp router-id 3.3.3.3
bgp log-neighbor-changes
neighbor 4.4.4.4 remote-as 1
neighbor 4.4.4.4 update-source Loopback0
no auto-summary
!
address-family ***v4
  neighbor 4.4.4.4 activate
  neighbor 4.4.4.4 send-community extended
exit-address-family
!
address-family ipv4 vrf A
  neighbor 13.13.13.1 remote-as 2
  neighbor 13.13.13.1 activate
  neighbor 13.13.13.1 route-map soo in
  neighbor 23.23.23.2 remote-as 2
  neighbor 23.23.23.2 activate
  neighbor 23.23.23.2 route-map soo in
  no synchronization
exit-address-family
!
route-map soo permit 10
set extcommunity soo 1:1
!
mpls ldp router-id Loopback0 force

 

R4:

ip vrf A
rd 100:1
route-target export 100:1
route-target import 100:1
!
interface Loopback0
ip address 4.4.4.4 255.255.255.255
!
interface FastEthernet0/0
ip address 34.34.34.4 255.255.255.0
duplex auto
speed auto
mpls ip
!
interface FastEthernet1/0
ip vrf forwarding A
ip address 45.45.45.4 255.255.255.0
duplex auto
speed auto
!
router eigrp 1
network 4.4.4.4 0.0.0.0
network 34.34.34.4 0.0.0.0
no auto-summary
!
router bgp 1
no synchronization
bgp router-id 4.4.4.4
bgp log-neighbor-changes
neighbor 3.3.3.3 remote-as 1
neighbor 3.3.3.3 update-source Loopback0
neighbor 3.3.3.3 next-hop-self
no auto-summary
!
address-family ***v4
  neighbor 3.3.3.3 activate
  neighbor 3.3.3.3 send-community extended
exit-address-family
!
address-family ipv4 vrf A
  neighbor 45.45.45.5 remote-as 2
  neighbor 45.45.45.5 activate
  no synchronization
exit-address-family
!
mpls ldp router-id Loopback0 force

 

image

image

BGP更新中携带了SoO扩展属性

image