實驗需求
1、R2-R7每臺路由器均存在一個環回接口用于建立鄰居,同時還存在一個環回來代表連接用戶的接口,最終這些連接用戶的接口網絡需要可以和R1和R8的環回通訊
2、AS2網段地址172.16.0.0/16 減少路由條目數量
實驗拓撲
實驗分析
這個拓撲圖中想實現的功能就是AS2兩邊各有一個AS,AS2內部的的用戶網段可以訪問兩邊的域外路由;AS2中采用了聯邦打破了BGP的水平分割,可以讓每臺路由器搬運路由,最終實現用戶互訪,在一個簇中,至少存在一個客戶端,一個RR(路由反射器)
聯邦:
將一個真實的大AS,邏輯的分為多個小AS;小AS的編號建議為私有編號;小AS間構建聯邦內的EBGP鄰居關系,可以向真實EBGP關系一樣傳遞路由條目,但不修改屬性; 對于該大AS外的其他AS,是不知道內部的小AS情況;
路由反射器:
3者構建一個簇;可以理解為RR為中心站點,客戶端或非客戶端是分支站點 ;RR從一臺非客戶端鄰居處學習到的路由條目,可以傳輸給本地的客戶端,其他EBGP鄰居;不得傳輸給本地的其他非客戶端;
AS2的ip地址規劃
172.16.0.0/16
172.16.0.0/18 --- 備份
172.16.64.0/18 ---- 骨干
172.16.64.0/30 23網段
172.16.64.4/30 34
172.16.64.8/30 47
172.16.64.12/30 67
172.16.64.16/30 56
172.16.64.20/30 25
l0
172.16.128.0/18 --- 建鄰環回
172.16.128.6/32 R2
172.16.128.1/32 R3
172.16.128.2/32 R4
172.16.128.3/32 R5
172.16.128.4/32 R6
172.16.128.5/32 R7
l1
172.16.192.0/18 --- 用戶
172.16.192.0/24 R2
172.16.193.0/24 R3
172.16.194.0/24 R4
172.16.195.0/24 R5
172.16.196.0/24 R6
172.16.197.0/24 R7
配置內容
根據上方ip規劃配置ip
AS2內起OSPF
【R2】 [r2]ospf1router-id2.2.2.2 [r2-ospf-1]area0 [r2-ospf-1-area-0.0.0.0]network172.16.64.10.0.0.0 [r2-ospf-1-area-0.0.0.0]network172.16.128.60.0.0.0 [r2-ospf-1-area-0.0.0.0]network172.16.192.10.0.0.0 [r2-ospf-1-area-0.0.0.0]network172.16.64.210.0.0.0 【R3】 [r3]ospf1ro [r3]ospf1router-id3.3.3.3 [r3-ospf-1]area0 [r3-ospf-1-area-0.0.0.0]network172.16.64.20.0.0.0 [r3-ospf-1-area-0.0.0.0]network172.16.64.50.0.0.0 [r3-ospf-1-area-0.0.0.0]network172.16.128.10.0.0.0 [r3-ospf-1-area-0.0.0.0]network172.16.193.10.0.0.0 【R4】 [r4]ospf1router-id4.4.4.4 [r4-ospf-1]area0 [r4-ospf-1-area-0.0.0.0]network172.16.64.60.0.0.0 [r4-ospf-1-area-0.0.0.0]network172.16.64.90.0.0.0 [r4-ospf-1-area-0.0.0.0]network172.16.128.20.0.0.0 [r4-ospf-1-area-0.0.0.0]network172.16.194.10.0.0.0 【R5】 [r5]ospf1router-id5.5.5.5 [r5-ospf-1]area0 [r5-ospf-1-area-0.0.0.0]network172.16.64.220.0.0.0 [r5-ospf-1-area-0.0.0.0]network172.16.64.170.0.0.0 [r5-ospf-1-area-0.0.0.0]network172.16.128.30.0.0.0 [r5-ospf-1-area-0.0.0.0]network172.16.195.10.0.0.0 【R6】 [r6]ospf1router-id6.6.6.6 [r6-ospf-1]area0 [r6-ospf-1-area-0.0.0.0]network172.16.64.180.0.0.0 [r6-ospf-1-area-0.0.0.0]network172.16.64.130.0.0.0 [r6-ospf-1-area-0.0.0.0]network172.16.128.40.0.0.0 [r6-ospf-1-area-0.0.0.0]network172.16.196.10.0.0.0 【R7】 [r7]ospf1router-id7.7.7.7 [r7-ospf-1]area0 [r7-ospf-1-area-0.0.0.0]network172.16.64.140.0.0.0 [r7-ospf-1-area-0.0.0.0]network172.16.64.100.0.0.0 [r7-ospf-1-area-0.0.0.0]network172.16.128.50.0.0.0 [r7-ospf-1-area-0.0.0.0]network172.16.197.10.0.0.0
disp ip ro pro ospf:查看路由表
發現連接用戶網段的變成了32為,所以要去R2-R7的int l1環回接口上ospf network-type broadcast更改網絡類型
建立EBGP關系
R1和R2,直連建鄰
【R1】 [r1]bgp1 [r1-bgp]router-id1.1.1.1 [r1-bgp]peer12.1.1.2as-number2 [r1-bgp]peer12.1.1.2ebgp-max-hop2 【R2】 [r2]bgp64512 [r2-bgp]confederationid2 [r2-bgp]peer12.1.1.1as-number1 [r2-bgp]peer12.1.1.1ebgp-max-hop2
R7和R8,直連建鄰
【R7】 [r7]bgp64513 [r7-bgp]router-id7.7.7.7 [r7-bgp]confederationid2 [r7-bgp]peer78.1.1.2as-number3 [r7-bgp]peer78.1.1.2ebgp-max-hop2 【R8】 [r8]bgp3 [r8-bgp]router-id8.8.8.8 [r8-bgp]peer78.1.1.1as-number2 [r8-bgp]peer78.1.1.1ebgp-max-hop2
R2-R4使用聯邦,虛擬AS號64512
【R2】 [r2]bgp64512 [r2-bgp]confederationid2 [r2-bgp]peer172.16.128.1as-number64512 [r2-bgp]peer172.16.128.1next-hop-local [r2-bgp]peer172.16.128.1connect-interfaceLoopBack0 【R3】 [r3]bgp64512 [r3-bgp]confederationid2 [r3-bgp]peer172.16.128.6as-number64512 [r3-bgp]peer172.16.128.6next-hop-local [r3-bgp]peer172.16.128.6connect-interfaceLoopBack0 [r3-bgp]peer172.16.128.2as-number64512 [r3-bgp]peer172.16.128.2next-hop-local [r3-bgp]peer172.16.128.2connect-interfaceLoopBack0 【R4】 [r4]bgp64512 [r4-bgp]confederationid2 [r4-bgp]peer172.16.128.1as-number64512 [r4-bgp]peer172.16.128.1next-hop-local [r4-bgp]peer172.16.128.1connect-interfaceLoopBack0
R5-R7使用聯邦,虛擬AS號64513
【R5】 [r5]bgp64513 [r5-bgp]confederationid2 [r5-bgp]peer172.16.128.4as-number64513 [r5-bgp]peer172.16.128.4next-hop-local [r5-bgp]peer172.16.128.4connect-interfaceLoopBack0 【R6】 [r6]bgp64513 [r6-bgp]confederationid2 [r6-bgp]peer172.16.128.3as-number64513 [r6-bgp]peer172.16.128.3next-hop-local [r6-bgp]peer172.16.128.3connect-interfaceLoopBack0 [r6-bgp]peer172.16.128.5as-number64513 [r6-bgp]peer172.16.128.5next-hop-local [r6-bgp]peer172.16.128.5connect-interfaceLoopBack0 【R7】 [r7]bgp64513 [r7-bgp]confederationid2 [r7-bgp]peer172.16.128.4as-number64513 [r7-bgp]peer172.16.128.4next-hop-local [r7-bgp]peer172.16.128.4connect-interfaceLoopBack0
然后注意的是R2和R5,R4和R7需要建立聯邦內的AS之間的鄰居關系
【R2】 [r2]64512 [r2-bgp]confederationpeer-as64513 [r2-bgp]peer172.16.128.3as-number64513 [r2-bgp]peer172.16.128.3ebgp-max-hop2 [r2-bgp]peer172.16.128.3connect-interfaceLoopBack0 【R5】 [r5]64513 [r5-bgp]confederationpeer-as64512 [r5-bgp]peer172.16.128.6as-number64512 [r5-bgp]peer172.16.128.6ebgp-max-hop2 [r5-bgp]peer172.16.128.6connect-interfaceLoopBack0 【R4】 [r4]bgp64512 [r4-bgp]confederationpeer-as64513 [r4-bgp]peer172.16.128.5as-number64513 [r4-bgp]peer172.16.128.5ebgp-max-hop2 [r4-bgp]peer172.16.128.5connect-interfaceLoopBack0 【R7】 [r7]bgp64513 [r7-bgp]confederationpeer-as64512 [r7-bgp]peer172.16.128.2as-number64512 [r7-bgp]peer172.16.128.2ebgp-max-hop2 [r7-bgp]peer172.16.128.2connect-interfaceLoopBack0
配置R1的環回和R8的環回能夠互訪
R1的路由宣告
【R1】 [r1]bgp1 [r1-bgp]network1.1.1.132
R8的路由宣告
【R8】 [r1]bgp3 [r1-bgp]network8.8.8.832
R3做路由反射器,R4為客戶端
[r3]bgp64512 [r3-bgp]peer172.16.128.2reflect-client
R6做路由反射器,R7為客戶端
[r6]bgp64513 [r6-bgp]peer172.16.128.5reflect-client
這樣所有路由器都能學到R1的環回,并且還優
AS2的路由宣告自己的客戶端網段
【R2】 [r2]bgp64512 [r2-bgp]network172.16.192.124 【R3】 [r3]bgp64512 [r3-bgp]network172.16.193.124 【R4】 [r4]bgp64512 [r4-bgp]network172.16.194.124 【R5】 [r5]bgp64513 [r5-bgp]network172.16.195.124 【R6】 [r6]bgp64513 [r6-bgp]network172.16.196.124 【R7】 [r7]bgp64513 [r7-bgp]network172.16.197.124
R1的BGP表
R8的BGP表
測試
R5的用戶訪問R1和R8的環回
其他也都能訪問
R1的環回訪問R8的環回
審核編輯:劉清
-
路由器
+關注
關注
22文章
3789瀏覽量
115511 -
BGP
+關注
關注
0文章
85瀏覽量
15552 -
反射器
+關注
關注
0文章
48瀏覽量
12333
原文標題:eNSP—BGP綜合實驗
文章出處:【微信號:網絡技術干貨圈,微信公眾號:網絡技術干貨圈】歡迎添加關注!文章轉載請注明出處。
發布評論請先 登錄
相關推薦
bgp配置實例講解 如何配置Cilium和BGP協同工作

動態BGP與靜態BGP的區別
bgp路由協議的路由屬性_BGP路由協議的優勢

什么是BGP高防,BGP高防的優勢是什么
華為新版模擬器eNSP Lite安裝攻略

華為新版模擬器eNSP Lite

什么是eNSP?華為網絡仿真平臺eNSP的使用方法

華為路由器BGP基礎配置實驗記錄

評論