實(shí)例解析BGP基本配置之路由反射器(3)
BGP檢查配置之前,我們向大家介紹了:BGP基本配置之中路由反射器實(shí)例的概述和基本配置
檢查BGP之RA
- RA#sh ip bgp
- Network Next Hop Metric LocPrf Weight Path
- *> 1.1.1.0/24 0.0.0.0 0 32768 i
- *> 2.2.2.0/24 192.1.1.2 0 0 200 i
- *> 3.3.3.0/24 192.1.1.2 0 200 i
可以看到RA已經(jīng)通過BGP學(xué)習(xí)到了各個(gè)虛擬接口,這兩條路由下一跳均為192.1.1.2。這里需指出當(dāng)AS邊界路由器通過EBGP轉(zhuǎn)發(fā)路由信息時(shí),總是將這些路由信息的下一跳設(shè)定為自己。
檢查BGP之RB
- RB#sh ip bgp
- Network Next Hop Metric LocPrf Weight Path
- *> 1.1.1.0/24 192.1.1.1 0 0 100 i
- *> 2.2.2.0/24 0.0.0.0 0 32768 i
- *>i3.3.3.0/24 193.1.1.2 0 100 0 i
可以看到RB也學(xué)習(xí)到了這些虛擬接口
檢查BGP之RC
- RC#sh ip bgp
- Network Next Hop Metric LocPrf Weight Path
- *>i1.1.1.0/24 192.1.1.1 0 100 0 100 i
- *>i2.2.2.0/24 193.1.1.1 0 100 0 i
- *> 3.3.3.0/24 0.0.0.0 0 32768 i
RC也學(xué)習(xí)到了這些路由
檢查BGP之RD
- RD#sh ip bgp
- Network Next Hop Metric LocPrf Weight Path
- *>i3.3.3.0/24 194.1.1.1 0 100 0 i
我們注意到這時(shí)RD并沒有學(xué)習(xí)到1.1.1.0/24和2.2.2.0/24兩個(gè)網(wǎng)段。這是因?yàn)樵谝粋€(gè)BGP域中,RC并不會將它通過RB學(xué)習(xí)到的路由轉(zhuǎn)發(fā)給RD。這是我們需要將RC配置成路由反射器。配置如下:
- RC(config)# router bgp 200
- RC(config)#neighbor 193.1.1.1 route-reflector-client
- RC(config)#neighbor 194.1.1.2 route-reflector-client
這兩條命令是將RB和RD設(shè)為RC的路由反射器客戶端
BGP再次檢查
我們再次在RD上進(jìn)行驗(yàn)證,之前用 clear ip bgp * 重啟BGP進(jìn)程,稍等一會兒在RD上進(jìn)行查看;
- RD#sh ip bgp
- Network Next Hop Metric LocPrf Weight Path
- *>i1.1.1.0/24 192.1.1.1 0 100 0 100 i
- *>i2.2.2.0/24 193.1.1.1 0 100 0 i
- *>i3.3.3.0/24 194.1.1.1 0 100 0 i
這時(shí)RD已經(jīng)學(xué)習(xí)到了所有的虛擬接口,至此我們的路由反射器配置成功。下面我們將通過查看路由表來追蹤這些路由信息。在這之前我們再次進(jìn)入所有路由器的 BGP進(jìn)程,輸入: no synchronization 來取消BGP與IGP的同步關(guān)系,使得IGP能學(xué)到BGP中的路由信息,再次 clearip bgp * 和 clear ip route * 稍等片刻,等待BGP鄰接關(guān)系再次建立后,我們在RB,RC,RD 分別用 sh iproute 就都能得到完整的路由信息了。以RC為例;
- RC#sh ip route
- Gateway of last resort is not set
- 1.0.0.0/24 is subnetted, 1 subnets
- B 1.1.1.0 [200/0] via 192.1.1.1, 02:08:19
- 2.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
- O 2.2.2.2/32 [110/11] via 193.1.1.1, 02:08:58, Ethernet0
- B 2.2.2.0/24 [200/0] via 193.1.1.1, 02:08:43
- 3.0.0.0/24 is subnetted, 1 subnets
- C 3.3.3.0 is directly connected, Loopback0
- C 193.1.1.0/24 is directly connected, Ethernet0
- O 192.1.1.0/24 [110/74] via 193.1.1.1, 02:08:58, Ethernet0
- C 194.1.1.0/24 is directly connected, Serial0
到現(xiàn)在為止,所有路由器的BGP表都已經(jīng)完整,RB,RC,RD的IP路由表也已經(jīng)完整,現(xiàn)在我們來看RA的路由表。
- RA#sh ip route
- Gateway of last resort is not set
- 1.0.0.0/24 is subnetted, 1 subnets
- C 1.1.1.0 is directly connected, Loopback0
- 2.0.0.0/24 is subnetted, 1 subnets
- B 2.2.2.0 [20/0] via 192.1.1.2, 02:18:43
- 3.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
- B 3.3.3.3/32 [20/11] via 192.1.1.2, 02:12:30
- B 3.3.3.0/24 [20/0] via 192.1.1.2, 02:18:43
- C 192.1.1.0/24 is directly connected, Serial0
我們可以看到在RA的路由表中并沒有193.1.1.0/24和194.1.1.0/24這兩個(gè)網(wǎng)段的路由,這是因?yàn)檫@兩條路由是在AS200中通過OSPF發(fā)布的,因此R1當(dāng)然無法學(xué)到。我們需要在AS邊界路由器RB上將OSPF的路由信息重發(fā)布到BGP中;配置如下:
- RB(config)#router bgp 200
- RB(config)#redistribute ospf 1
再次來到RA中,
- RA#sh ip route
- Gateway of last resort is not set
- 1.0.0.0/24 is subnetted, 1 subnets
- C 1.1.1.0 is directly connected, Loopback0
- 2.0.0.0/24 is subnetted, 1 subnets
- B 2.2.2.0 [20/0] via 192.1.1.2, 02:26:51
- 3.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
- B 3.3.3.3/32 [20/11] via 192.1.1.2, 02:20:39
- B 3.3.3.0/24 [20/0] via 192.1.1.2, 02:26:51
- B 193.1.1.0/24 [20/0] via 192.1.1.2, 02:20:38
- C 192.1.1.0/24 is directly connected, Serial0
- B 194.1.1.0/24 [20/74] via 192.1.1.2, 02:20:38
我們可以看到這兩條路由已經(jīng)被RA學(xué)習(xí)到了。
BGP基本配置中路由反射器的配置就介紹完了,希望大家已經(jīng)掌握。
【編輯推薦】