【實驗環境】
C3640-IK9O3S-M Version 12.4(10)
【實驗目的】
采用路由反射器(Router Reflector)解決由IBGP水平分割導致的BGP路由黑洞問題
【實驗拓撲】
【實驗描述】
R1、R2、R4、R5跑BGP協議,R2、R3、R4跑OSPF協議。目標是使1.1.1.1<->5.5.5.5可以互相訪問
IBGP鄰居關系采用回環口進行建立
R1<->R2、R4<->R5之間使用直連接口建立EBGP關系
數據層面的BGP路由黑洞問題:由于R3沒有跑BGP,因此R2和R4均不會將路由條目傳給R3,因此R3沒有1.1.1.1和5.5.5.5的路由,導致路由黑洞。如果在R3上跑BGP,與R2和R4建立IBGP關系,又會因為IBGP水平分割導致R2、R4路由學習不完整。
解決方法:利用路由反射器,將R3作為反射器(RR),其余IBGP路由器作為客戶端(C),路由反射器和其客戶端共同組成路由反射簇,客戶端只需要與路由反射器建立鄰居即可,不需要與每臺IBGP路由器建立鄰居。
路由反射器的規則:
1、RR從EBGP收到的路由,會反射給客戶端和非客戶端;
2、從客戶端收到的路由,會反射給客戶端、非客戶端及EBGP鄰居;
3、從非客戶端收到的路由,只會反射給客戶端和EBGP鄰居,不會反射給其他非客戶端。
【實驗步驟】
1、R1基本配置,端口:
!
interface Loopback0
ip address 1.1.1.1 255.255.255.0
!
interface Serial0/0
ip address 12.0.0.1 255.255.255.0
clock rate 64000
!
2、R2基本配置,端口,OSPF:
!
interface Loopback0
ip address 2.2.2.2 255.255.255.0
!
interface Serial0/0
ip address 12.0.0.2 255.255.255.0
!
interface Serial0/1
ip address 23.0.0.1 255.255.255.0
clock rate 64000
!
router ospf 110
router-id 2.2.2.2
network 2.2.2.0 0.0.0.255 area 0
network 23.0.0.1 0.0.0.0 area 0
!
3、R3基本配置,端口,OSPF:
!
interface Loopback0
ip address 3.3.3.3 255.255.255.0
!
interface Serial0/0
ip address 34.0.0.1 255.255.255.0
clock rate 64000
!
interface Serial0/1
ip address 23.0.0.2 255.255.255.0
!
router ospf 110
router-id 3.3.3.3
network 3.3.3.0 0.0.0.255 area 0
network 23.0.0.2 0.0.0.0 area 0
network 34.0.0.1 0.0.0.0 area 0
!
4、R4基本配置,端口,OSPF:
!
interface Loopback0
ip address 4.4.4.4 255.255.255.0
!
interface Serial0/0
ip address 34.0.0.2 255.255.255.0
!
interface Serial0/1
ip address 45.0.0.1 255.255.255.0
clock rate 64000
!
router ospf 110
router-id 4.4.4.4
network 4.4.4.0 0.0.0.255 area 0
network 34.0.0.2 0.0.0.0 area 0
!
5、R5基本配置,端口:
!
interface Loopback0
ip address 5.5.5.5 255.255.255.0
!
interface Serial0/1
ip address 45.0.0.2 255.255.255.0
!
6、配置R1與R2之間的EBGP
//R1配置AS 1
router bgp 1
no synchronization
bgp router-id 1.1.1.1
network 1.1.1.0 mask 255.255.255.0
neighbor 12.0.0.2 remote-as 3
no auto-summary
//R2配置AS 3
router bgp 3
no synchronization
bgp router-id 2.2.2.2
neighbor 12.0.0.1 remote-as 1
no auto-summary
7、配置R4與R5之間的EBGP
//R4配置AS 3
router bgp 3
no synchronization
bgp router-id 4.4.4.4
neighbor 45.0.0.2 remote-as 5
no auto-summary
//R5配置AS 5
router bgp 5
no synchronization
bgp router-id 5.5.5.5
network 5.5.5.0 mask 255.255.255.0
neighbor 45.0.0.1 remote-as 3
no auto-summary
8、使用回環接口配置R2、R3、R4之間的IBGP關系
//R3配置
router bgp 3
no synchronization
bgp router-id 3.3.3.3
neighbor 2.2.2.2 remote-as 3
neighbor 2.2.2.2 update-source Loopback0
neighbor 4.4.4.4 remote-as 3
neighbor 4.4.4.4 update-source Loopback0
no auto-summary
//R2配置
router bgp 3
neighbor 3.3.3.3 remote-as 3
neighbor 3.3.3.3 update-source Loopback0
nei 3.3.3.3 next-hop-self
//R4配置
router bgp 3
neighbor 3.3.3.3 remote-as 3
neighbor 3.3.3.3 update-source Loopback0
nei 3.3.3.3 next-hop-self
9、在R3上開啟路由反射器,指定客戶端
router bgp 3
neighbor 2.2.2.2 route-reflector-client
neighbor 4.4.4.4 route-reflector-client
10、查看R3的路由表
R3#sh ip bgp
BGP table version is 3, local router ID is 3.3.3.3
Network Next Hop Metric LocPrf Weight Path
*>i1.1.1.0/24 2.2.2.2 0 100 0 1 i
*>i5.5.5.0/24 4.4.4.4 0 100 0 5 i
11、驗證R1與R5回環口連通性
R1#ping 5.5.5.5 so 1.1.1.1
Sending 5, 100-byte ICMP Echos to 5.5.5.5, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 188/325/496 ms
12、在R2上查看反射路由條目5.5.5.0/24
R2#sh ip bgp 5.5.5.0/24
BGP routing table entry for 5.5.5.0/24, version 3
Paths: (1 available, best #1, table Default-IP-Routing-Table)
4.4.4.4 (metric 129) from 3.3.3.3 (3.3.3.3)
Origin IGP, metric 0, localpref 100, valid, internal, best
Originator: 4.4.4.4, Cluster list: 3.3.3.3
13、在R4上查看反射路由條目1.1.1.0/24
R4#sh ip bgp 1.1.1.0/24
BGP routing table entry for 1.1.1.0/24, version 3
Paths: (1 available, best #1, table Default-IP-Routing-Table)
2.2.2.2 (metric 129) from 3.3.3.3 (3.3.3.3)
Origin IGP, metric 0, localpref 100, valid, internal, best
Originator: 2.2.2.2, Cluster list: 3.3.3.3
14、評價
路由反射器相對于鄰居全互聯來說,簡化了配置和數量,因為IBGP鄰居關系只需要在客戶端與RR之間建立即可。