BGP分解实验·24——BGP选路原则之路由反射器簇列表

当目的路由在路由反射器的配置中被反射时,反射器会将自身簇ID添加到该路由的簇列表属性中;簇ID属性用于在反射器的配置中防止反射簇之间形成环路。

在选路时会优选反射器列表最短的路径。

实验设计为底层ospf打通,使R4作为反射器,使其缩小,且免于形成全互联的配置,所以使用反射器的做法,又验证簇列表长度,所以又在R5和R6之间再建立邻居,再形成一次反射增加一次长度观察效果。所以实验配置如下所示:

根据实验拓扑完成的实验基础配置R1如下:

bash 复制代码
hostname R1
!
interface Loopback0
 ip address 1.1.1.1 255.255.255.255
 ip ospf 1 area 0
!
interface Ethernet0/0
 ip address 10.106.15.1 255.255.255.0
 no shutdown
 ip ospf 1 area 0
!
interface Ethernet0/1
 ip address 100.100.13.1 255.255.255.252
 no shutdown
!
interface Ethernet0/3
 ip address 10.106.124.1 255.255.255.0
 no shutdown
 ip ospf 1 area 0
!
router bgp 12456
 bgp router-id 1.1.1.1
 neighbor 4.4.4.4 remote-as 12456
 neighbor 4.4.4.4 update-source Loopback0
 neighbor 4.4.4.4 next-hop-self
 neighbor 100.100.13.2 remote-as 3
!         
end

实验基础配置R2如下:

bash 复制代码
hostname R2
!
interface Loopback0
 ip address 2.2.2.2 255.255.255.255
 ip ospf 1 area 0
!
interface Ethernet0/0
 ip address 10.106.26.2 255.255.255.0
 no shutdown
 ip ospf 1 area 0
!
interface Ethernet0/2
 ip address 100.101.23.1 255.255.255.252
 no shutdown
!
interface Ethernet0/3
 ip address 10.106.124.2 255.255.255.0
 no shutdown
 ip ospf 1 area 0
!
router bgp 12456
 bgp router-id 2.2.2.2
 neighbor 4.4.4.4 remote-as 12456
 neighbor 4.4.4.4 update-source Loopback0
 neighbor 4.4.4.4 next-hop-self
 neighbor 100.101.23.2 remote-as 3
!
end

实验基础配置R3如下:

bash 复制代码
hostname R3
!
interface Loopback0
 ip address 3.3.3.3 255.255.255.255
!
interface Ethernet0/1
 ip address 100.100.13.2 255.255.255.252
 no shutdown
!
interface Ethernet0/2
 ip address 100.101.23.2 255.255.255.252
 no shutdown
!
router bgp 3
 bgp router-id 10.3.255.3
 network 3.3.3.3 mask 255.255.255.255
 neighbor 100.100.13.1 remote-as 12456
 neighbor 100.101.23.1 remote-as 12456
!
end

实验基础配置R4如下:

bash 复制代码
hostname R4
!
interface Loopback0
 ip address 4.4.4.4 255.255.255.255
 ip ospf 1 area 0
!
interface Ethernet0/1
 ip address 10.106.45.4 255.255.255.0
 no shutdown
 ip ospf 1 area 0
!
interface Ethernet0/2
 ip address 10.106.46.4 255.255.255.0
 no shutdown
 ip ospf 1 area 0
!
interface Ethernet0/3
 ip address 10.106.124.4 255.255.255.0
 no shutdown
 ip ospf 1 area 0
!
router bgp 12456
 bgp router-id 4.4.4.4
 neighbor IBGP peer-group
 neighbor IBGP remote-as 12456
 neighbor IBGP update-source Loopback0
 neighbor IBGP route-reflector-client
 neighbor 1.1.1.1 peer-group IBGP
 neighbor 2.2.2.2 peer-group IBGP
 neighbor 5.5.5.5 peer-group IBGP
 neighbor 6.6.6.6 peer-group IBGP
!
end

实验基础配置R5如下:

bash 复制代码
hostname R5
!
interface Loopback0
 ip address 5.5.5.5 255.255.255.255
 ip ospf 1 area 0
!
interface Ethernet0/0
 ip address 10.106.15.5 255.255.255.0
 no shutdown
 ip ospf 1 area 0
!
interface Ethernet0/1
 ip address 10.106.45.5 255.255.255.0
 no shutdown
 ip ospf 1 area 0
!
interface Ethernet0/3
 ip address 10.106.56.5 255.255.255.0
 no shutdown
 ip ospf 1 area 0
!
router bgp 12456
 bgp router-id 5.5.5.5
 neighbor 4.4.4.4 remote-as 12456
 neighbor 4.4.4.4 update-source Loopback0
 neighbor 6.6.6.6 remote-as 12456
 neighbor 6.6.6.6 update-source Loopback0
!
end

实验基础配置R6如下:

bash 复制代码
hostname R6
!
interface Loopback0
 ip address 6.6.6.6 255.255.255.0
 ip ospf 1 area 0
!
interface Ethernet0/0
 ip address 10.106.26.6 255.255.255.0
 no shutdown
 ip ospf 1 area 0
!
interface Ethernet0/2
 ip address 10.106.46.6 255.255.255.0
 no shutdown
 ip ospf 1 area 0
!
interface Ethernet0/3
 ip address 10.106.56.6 255.255.255.0
 no shutdown
 ip ospf 1 area 0
!
router bgp 12456
 bgp router-id 6.6.6.6
 neighbor 4.4.4.4 remote-as 12456
 neighbor 4.4.4.4 update-source Loopback0
 neighbor 5.5.5.5 remote-as 12456
 neighbor 5.5.5.5 update-source Loopback0
 neighbor 5.5.5.5 route-reflector-client
!
end

首先,在R4上观察去往3.3.3.3的BGP路由信息,该NLRI来自R1/R2,当R4作为路由反射器会将其反射给R5和R6,同时增加簇列表属性并添加自己的簇ID。

在R6上再观察此路由信息,该路由被R4反射过来,携带簇列表信息并包含簇列表信息4.4.4.4。

为了观察其不同长度的簇列表选路的差异再R6上配置了反射器并指定R5是其客户端,观察其簇列表效果为:

由此可见,BGP在具有iBGP的路由反射器配置中的选路会优选簇列表较短的路由。