【實驗題目】
注:圖中每個黑線代表一個環回,黑線所指向的區域即為環回所在區域;紫色連線代表MGRE環境
【實驗思路】
1、首先要劃分私網IP地址。考慮到以后每個區域的路由可以路由匯總,那么需要為每個區域劃分一個大網段。圖中有area0、area1、area2、area3、area4和rip共6個區域,所以將172.16.0.0/16劃分為172.16.0.0/19、172.16.32.0/19、172.16.64.0/19、172.16.96.0/19、172.16.128.0/19、172.16.160.0/19分別為這六個區域的網段,剩余兩個網段備用。每個區域內又分為P2P骨干鏈路、MA骨干鏈路、末梢鏈路,更具體的劃分見下表:
area 0 172.16.0.0/19 |
P2P 172.16.0.0/24 |
172.16.0.0/30 172.16.0.4/30 172.16.0.8/30 …… |
MA 172.16.1.0/24 |
172.16.1.0/29 172.16.1.8/29 172.16.1.16/29 …… |
|
STUB 172.16.2.0/24 172.16.3.0/24 …… |
||
area 1 172.16.32.0/19 |
P2P 172.16.32.0/24 |
172.16.32.0/30 172.16.32.4/30 172.16.32.8/30 …… |
MA 172.16.33.0/24 |
172.16.33.0/29 172.16.33.8/29 172.16.33.16/29 …… |
|
STUB 172.16.34.0/24 172.16.35.0/24 …… |
||
area 2 172.16.64.0/19 |
P2P 172.16.64.0/24 |
172.16.64.0/30 172.16.64.4/30 172.16.64.8/30 …… |
MA 172.16.65.0/24 |
172.16.65.0/29 172.16.65.8/29 172.16.65.16/29 …… |
|
STUB 172.16.66.0/24 172.16.67.0/24 …… |
||
area 3 172.16.96.0/19 |
P2P 172.16.96.0/24 |
172.16.96.0/30 172.16.96.4/30 172.16.96.8/30 …… |
MA 172.16.97.0/24 |
172.16.97.0/29 172.16.97.8/29 172.16.97.16/29 …… |
|
STUB 172.16.98.0/24 172.16.99.0/24 …… |
||
area 4 172.16.128.0/19 |
P2P 172.16.128.0/24 |
172.16.128.0/30 172.16.128.4/30 172.16.128.8/30 …… |
MA 172.16.129.0/24 |
172.16.129.0/29 172.16.129.8/29 172.16.129.16/29 …… |
|
STUB 172.16.130.0/24 172.16.131.0/24 …… |
||
rip 172.16.160.0/19 |
P2P 172.16.160.0/24 |
172.16.160.0/30 172.16.160.4/30 172.16.160.8/30 …… |
MA 172.16.161.0/24 |
172.16.161.0/29 172.16.161.8/29 172.16.161.16/29 …… |
|
STUB 172.16.162.0/24 172.16.163.0/24 …… |
2、劃分好網段后就可以配IP,并使公網通暢;配置R3-R5/6/7的MGRE環境;配置基本的OSPF和RIP;所有設備均可訪問R4的環回,說明需要做NAT;減少LSA的更新量,說明需要做路由匯總和特殊區域,此時,就可以考慮area4這個不規則區域與area0的連接方式,為使area3能夠成為特殊區域,那么area4就不能做虛鏈路,可做多線程重發布(需要注意的是:當匯總遇到缺省時一定要配置NULL 0防環);加速收斂可以考慮減少計時器時間、將直連的broadcast接口網絡類型改為p2p模式等;保障更新安全,說明需要做OSPF的認證
【實驗記錄】
一、配置IP地址
[r1]intGigabitEthernet0/0/0 [r1-GigabitEthernet0/0/0]ipaddress172.16.33.129 [r1]intLoopBack0 [r1-LoopBack0]ipaddress172.16.34.124
[r2]intg0/0/0 [r2-GigabitEthernet0/0/0]ipaddress172.16.33.229 [r2]intLoopBack0 [r2-LoopBack0]ipaddress172.16.35.124
[r3]intg0/0/0 [r3-GigabitEthernet0/0/0]ipaddress172.16.33.329 [r3]intLoopBack0 [r3-LoopBack0]ipaddress172.16.36.124 [r3]intSerial4/0/0 [r3-Serial4/0/0]ipaddress34.0.0.124
[r4]ints4/0/0 [r4-Serial4/0/0]ipaddress34.0.0.224 [r4]ints4/0/1 [r4-Serial4/0/1]ipaddress45.0.0.224 [r4]ints3/0/0 [r4-Serial3/0/0]ipaddress46.0.0.224 [r4-Serial3/0/0]intg0/0/0 [r4-GigabitEthernet0/0/0]ipaddress47.0.0.224 [r4]intLoopBack0 [r4-LoopBack0]ipaddress4.4.4.424
[r5]ints4/0/0 [r5-Serial4/0/0]ipaddress45.0.0.124 [r5]intLoopBack0 [r5-LoopBack0]ipaddress172.16.2.124
[r6]ints4/0/0 [r6-Serial4/0/0]ipaddress46.0.0.124 [r6]intLoopBack0 [r6-LoopBack0]ipaddress172.16.3.124 [r6]intGigabitEthernet0/0/0 [r6-GigabitEthernet0/0/0]ipaddress172.16.65.129
[r7]intg0/0/0 [r7-GigabitEthernet0/0/0]ipaddress47.0.0.124 [r7]intg0/0/1 [r7-GigabitEthernet0/0/1]ipaddress172.16.97.129 [r7]intLoopBack0 [r7-LoopBack0]ipaddress172.16.4.124
[r8]intg0/0/0 [r8-GigabitEthernet0/0/0]ipaddress172.16.97.229 [r8]intg0/0/1 [r8-GigabitEthernet0/0/1]ipaddress172.16.97.929 [r8]intLoopBack0 [r8-LoopBack0]ipaddress172.16.98.124
[r9]intg0/0/0 [r9-GigabitEthernet0/0/0]ipaddress172.16.97.1029 [r9]intg0/0/1 [r9-GigabitEthernet0/0/1]ipaddress172.16.129.129 [r9]intLoopBack0 [r9-LoopBack0]ipaddress172.16.130.124
[r10]intg0/0/0 [r10-GigabitEthernet0/0/0]ipaddress172.16.129.229 [r10]intLoopBack0 [r10-LoopBack0]ipaddress172.16.131.124
[r11]intg0/0/0 [r11-GigabitEthernet0/0/0]ipaddress172.16.65.229 [r11]intg0/0/1 [r11-GigabitEthernet0/0/1]ipaddress172.16.65.929 [r11]intLoopBack0 [r11-LoopBack0]ipaddress172.16.66.124
[r12]intg0/0/0 [r12-GigabitEthernet0/0/0]ipaddress172.16.65.1029 [r12]intLoopBack0 [r12-LoopBack0]ipaddress172.16.162.124 [r12]intLoopBack1 [r12-LoopBack1]ipaddress172.16.163.124
二、配置缺省路由使公網通暢
[r3]iproute-static0.0.0.0034.0.0.2
[r5]iproute-static0.0.0.0045.0.0.2
[r6]iproute-static0.0.0.0046.0.0.2
[r7]iproute-static0.0.0.0047.0.0.2
ping通測試,確保無誤
三、搭建MGRE環境
[r3]intTunnel0/0/0 [r3-Tunnel0/0/0]ipaddress172.16.1.129 [r3-Tunnel0/0/0]tunnel-protocolgrep2mp [r3-Tunnel0/0/0]source34.0.0.1 [r3-Tunnel0/0/0]nhrpnetwork-id100 [r3-Tunnel0/0/0]nhrpentrymulticastdynamic
[r5]intTunnel0/0/0 [r5-Tunnel0/0/0]ipaddress172.16.1.229 [r5-Tunnel0/0/0]tunnel-protocolgrep2mp [r5-Tunnel0/0/0]sourceSerial4/0/0 [r5-Tunnel0/0/0]nhrpnetwork-id100 [r5-Tunnel0/0/0]nhrpentry172.16.1.134.0.0.1register
[r6]intTunnel0/0/0 [r6-Tunnel0/0/0]ipaddress172.16.1.329 [r6-Tunnel0/0/0]tunnel-protocolgrep2mp [r6-Tunnel0/0/0]nhrpnetwork-id100 [r6-Tunnel0/0/0]sourceSerial4/0/0 [r6-Tunnel0/0/0]nhrpentry172.16.1.134.0.0.1register
[r7]intTunnel0/0/0 [r7-Tunnel0/0/0]ipaddress172.16.1.429 [r7-Tunnel0/0/0]tunnel-protocolgrep2mp [r7-Tunnel0/0/0]nhrpnetwork-id100 [r7-Tunnel0/0/0]sourceGigabitEthernet0/0/0 [r7-Tunnel0/0/0]nhrpentry172.16.1.134.0.0.1register
查看nhrp鄰居表,ping通測試確保無誤
將MGRE環境的隧道接口網絡類型改為p2mp類型
[r3]intTunnel0/0/0 [r3-Tunnel0/0/0]ospfnetwork-typep2mp
[r5]intTunnel0/0/0 [r5-Tunnel0/0/0]ospfnetwork-typep2mp
[r6]intTunnel0/0/0 [r6-Tunnel0/0/0]ospfnetwork-typep2mp
[r7]intTunnel0/0/0 [r7-Tunnel0/0/0]ospfnetwork-typep2mp
四、配置OSPF和RIP
[r1]ospf1router-id1.1.1.1 [r1-ospf-1]a1 [r1-ospf-1-area-0.0.0.1]net [r1-ospf-1-area-0.0.0.1]network172.16.0.00.0.255.255
[r2]ospf1router-id2.2.2.2 [r2-ospf-1]a1 [r2-ospf-1-area-0.0.0.1]net [r2-ospf-1-area-0.0.0.1]network172.16.0.00.0.255.255
[r3]ospf1router-id3.3.3.3 [r3-ospf-1]a1 [r3-ospf-1-area-0.0.0.1]network172.16.32.00.0.7.255 [r3-ospf-1-area-0.0.0.1]q [r3-ospf-1]a0 [r3-ospf-1-area-0.0.0.0]network172.16.1.10.0.0.0
[r5]ospf1router-id5.5.5.5 [r5-ospf-1]a0 [r5-ospf-1-area-0.0.0.0]network172.16.0.00.0.255.255
[r6]ospf1router-id6.6.6.6 [r6-ospf-1]a0 [r6-ospf-1-area-0.0.0.0]network172.16.0.00.0.3.255 [r6-ospf-1-area-0.0.0.0]q [r6-ospf-1]a2 [r6-ospf-1-area-0.0.0.2]network172.16.65.10.0.0.0
[r7]ospf1router-id7.7.7.7 [r7-ospf-1]a0 [r7-ospf-1-area-0.0.0.0]network172.16.0.00.0.7.255 [r7-ospf-1-area-0.0.0.0]q [r7-ospf-1]a3 [r7-ospf-1-area-0.0.0.3]network172.16.97.10.0.0.0
[r8]ospf1router-id8.8.8.8 [r8-ospf-1]a3 [r8-ospf-1-area-0.0.0.3]net [r8-ospf-1-area-0.0.0.3]network172.16.0.00.0.255.255
[r9]ospf1router-id9.9.9.9 [r9-ospf-1]a3 [r9-ospf-1-area-0.0.0.3]network172.16.97.100.0.0.0 [r9-ospf-1-area-0.0.0.3]q [r9-ospf-1]q [r9]ospf2 [r9-ospf-2]a4 [r9-ospf-2-area-0.0.0.4]network172.16.128.00.0.3.255
[r10]ospf1router-id10.10.10.10 [r10-ospf-1]a4 [r10-ospf-1-area-0.0.0.4]network172.16.0.00.0.255.255
[r11]ospf1router-id11.11.11.11 [r11-ospf-1]a2 [r11-ospf-1-area-0.0.0.2]network172.16.0.00.0.255.255
[r12]ospf1router-id12.12.12.12 [r12-ospf-1]a2 [r12-ospf-1-area-0.0.0.2]network172.16.65.100.0.0.0 [r12-ospf-1-area-0.0.0.2]q [r12-ospf-1]q [r12]rip [r12-rip-1]v2 [r12-rip-1]net [r12-rip-1]network172.16.0.0
“
注意:此時rip的宣告因為是按主類宣告,所以也會將172.16.65.10宣告進rip網絡
”
將rip和area 4重發布到ospf中
[r9]ospf1 [r9-ospf-1]import-routeospf2
[r12]ospf1 [r12-ospf-1]import-routerip1
為了使area 4能夠到達其他區域,同時為了減少LSA更新量,可以在R10上手工配置一條指向R9的缺省,也可以在R9上下發一條5類缺省:
[r9-ospf-2]default-route-advertise
R5的ospf路由表:
五、OSPF路由匯總
[r3]ospf1 [r3-ospf-1]a1 [r3-ospf-1-area-0.0.0.1]abr-summary172.16.32.0255.255.224.0
[r6]ospf1 [r6-ospf-1]a2 [r6-ospf-1-area-0.0.0.2]abr-summary172.16.64.0255.255.224.0
[r7]ospf1 [r7-ospf-1]a3 [r7-ospf-1-area-0.0.0.3]abr-summary172.16.96.0255.255.224.0
[r9]ospf1 [r9-ospf-1]asbr-summary172.16.128.0255.255.224.0
[r12]ospf1 [r12-ospf-1]asbr-summary172.16.160.0255.255.224.0
查看R5的ospf路由表:
發現多了一條本該匯總到172.16.64.0/19的172.16.65.8/29路由,這是由rip重發布進來的。匯總之前該路由是域間路由,而匯總后變為了域外路由,是因為匯總之前相同網段的域間路由的優先級高于域外路由,所以學習域間路由,而匯總后匯總的網段就變了,就學習到了該域外路由。該路由會在后面做完特殊區域后消失。
六、為area1、area2、area3做特殊區域
1、area1的完全末梢區域
[r1]ospf1 [r1-ospf-1]a1 [r1-ospf-1-area-0.0.0.1]stub
[r2]ospf1 [r2-ospf-1]a1 [r2-ospf-1-area-0.0.0.1]stub
[r3]ospf1 [r3-ospf-1]a1 [r3-ospf-1-area-0.0.0.1]stubno-summary
查看area1的lsdb表:
查看路由表:
2、area2的完全的非完全末梢區域
[r6]ospf1 [r6-ospf-1]a2 [r6-ospf-1-area-0.0.0.2]nssano-summary
[r11]ospf1 [r11-ospf-1]a2 [r11-ospf-1-area-0.0.0.2]nssa
[r12]ospf1 [r12-ospf-1]a2 [r12-ospf-1-area-0.0.0.2]nssa
查看area2的lsdb表:
查看路由表:
3、area3的完全的非完全末梢區域
[r7]ospf1 [r7-ospf-1]a3 [r7-ospf-1-area-0.0.0.3]nssano-summary
[r8]ospf1 [r8-ospf-1]a3 [r8-ospf-1-area-0.0.0.3]nssa
[r9]ospf1 [r9-ospf-1]a3 [r9-ospf-1-area-0.0.0.3]nssa
查看area3的lsdb表:
查看路由表:
七、配置NULL 0接口防環
[r3]iproute-static172.16.32.019NULL0
[r6]iproute-static172.16.64.019NULL0
[r7]iproute-static172.16.96.019NULL0
[r9]iproute-static172.16.128.019NULL0
[r12]iproute-static172.16.160.019NULL0
八、配置NAT
[r3]acl2000 [r3-acl-basic-2000]rulepermitsource172.16.0.00.0.255.255 [r3-acl-basic-2000]q [r3]intSerial4/0/0 [r3-Serial4/0/0]natoutbound2000
[r6]acl2000 [r6-acl-basic-2000]rulepermitsource172.16.0.00.0.255.255 [r6-acl-basic-2000]q [r6]intSerial4/0/0 [r6-Serial4/0/0]natoutbound2000
[r7]acl2000 [r7-acl-basic-2000]rulepermitsource172.16.0.00.0.255.255 [r7-acl-basic-2000]q [r7]intGigabitEthernet0/0/0 [r7-GigabitEthernet0/0/0]natoutbound2000
ping測試
至此,全網可達。
九、加快收斂
1、為MGRE環境減少計時器時間
[r3]intTunnel0/0/0 [r3-Tunnel0/0/0]ospftimerhello10
[r5]intt0/0/0 [r5-Tunnel0/0/0]ospftimerhello10
[r6]intt0/0/0 [r6-Tunnel0/0/0]ospftimerhello10
[r7]intt0/0/0 [r7-Tunnel0/0/0]ospftimerhello10
2、將所有直連的MA的接口網絡類型改為p2p
[r7]intg0/0/1 [r7-GigabitEthernet0/0/1]ospfnetwork-typep2p
[r8]intg0/0/0 [r8-GigabitEthernet0/0/0]ospfnetwork-typep2p [r8]intg0/0/1 [r8-GigabitEthernet0/0/1]ospfnetwork-typep2p
[r9]intg0/0/0 [r9-GigabitEthernet0/0/0]ospfnetwork-typep2p [r9]intg0/0/1 [r9-GigabitEthernet0/0/1]ospfnetwork-typep2p
[r10]intg0/0/0 [r10-GigabitEthernet0/0/0]ospfnetwork-typep2p
[r6]intg0/0/0 [r6-GigabitEthernet0/0/0]ospfnetwork-typep2p
[r11]intg0/0/0 [r11-GigabitEthernet0/0/0]ospfnetwork-typep2p [r11]intg0/0/1 [r11-GigabitEthernet0/0/1]ospfnetwork-typep2p
[r12]intg0/0/0 [r12-GigabitEthernet0/0/0]ospfnetwork-typep2p
十、OSPF認證
[r1-ospf-1-area-0.0.0.1]authentication-modemd51cipher123456
[r2-ospf-1-area-0.0.0.1]authentication-modemd51cipher123456
[r3-ospf-1-area-0.0.0.1]authentication-modemd51cipher123456 [r3-ospf-1-area-0.0.0.0]authentication-modemd51cipher123456
[r5-ospf-1-area-0.0.0.0]authentication-modemd51cipher123456
[r6-ospf-1-area-0.0.0.0]authentication-modemd51cipher123456 [r6-ospf-1-area-0.0.0.2]authentication-modemd51cipher123456
[r7-ospf-1-area-0.0.0.0]authentication-modemd51cipher123456 [r7-ospf-1-area-0.0.0.3]authentication-modemd51cipher123456
[r8-ospf-1-area-0.0.0.3]authentication-modemd51cipher123456
[r9-ospf-1-area-0.0.0.3]authentication-modemd51cipher123456 [r9-ospf-2-area-0.0.0.4]authentication-modemd51cipher123456
[r10-ospf-1-area-0.0.0.4]authentication-modemd51cipher123456
[r11-ospf-1-area-0.0.0.2]authentication-modemd51cipher123456
[r12-GigabitEthernet0/0/0]ospfauthentication-modemd51cipher123456
至此,實驗全部完成。
審核編輯:湯梓紅
-
接口
+關注
關注
33文章
8580瀏覽量
151029 -
華為
+關注
關注
216文章
34417瀏覽量
251518 -
路由器
+關注
關注
22文章
3728瀏覽量
113708 -
ip地址
+關注
關注
0文章
301瀏覽量
17032 -
OSPF
+關注
關注
0文章
80瀏覽量
14878
原文標題:華為路由器OSPF綜合實驗,步驟非常齊全!
文章出處:【微信號:網絡技術干貨圈,微信公眾號:網絡技術干貨圈】歡迎添加關注!文章轉載請注明出處。
發布評論請先 登錄
相關推薦
評論