OSPF綜合大實(shí)驗(yàn)

實(shí)驗(yàn)要求:

1、R4為ISP,其上只配置IP地址;R4與其他所直連設(shè)備間均使用公有IP;

2、R3-R5、R6、R7為MGRE環(huán)境,R3為中心站點(diǎn);

3、整個(gè)OSPF環(huán)境IP基于172.16.0.0/16劃分;除了R12有兩個(gè)環(huán)回,其他路由器均有一個(gè)環(huán)回IP

4、所有設(shè)備均可訪問R4的環(huán)回;

5、減少LSA的更新量,加快收斂,保障更新安全;

6、全網(wǎng)可達(dá);
image.png

1、 劃分IP地址(基于區(qū)域劃分)

已知OSPF環(huán)境基于172.16.0.0/16劃分,共5個(gè)區(qū)域,因此可以給5個(gè)大網(wǎng)段,區(qū)域下的主機(jī)及路由器根據(jù)大網(wǎng)段分配IP地址 172.16.00000000.0/16

172.16.00000000.0/24 ----172.16.0.0/24(Area 0)

R3環(huán)回:172.16.0.000 00000/27---172.16.0.0/27

R4環(huán)回:172.16.0.001 00000/27---172.16.0.32/27

R5環(huán)回:172.16.0.010 00000/27---172.16.0.64/27

R6環(huán)回:172.16.0.011 00000/27---172.16.0.96/27

R7環(huán)回:172.16.0.100 00000/27---172.16.0.128/27

隧道地址:172.16.0.101 00000/27---172.16.0.160/27

172.16.00000001.0/24----172.16.1.0/24(Area 1)

骨干鏈路:172.16.1.00 000000/26
172.16.1.00000 000/29---172.16.1.0/29

R1環(huán)回:172.16.1.01 000000/26---172.16.1.64/26
R2環(huán)回:172.16.1.10 000000/26---172.16.1.128/26

172.16.00000010.0/24----172.16.2.0/24(Area 2)

172.16.2.0 0000000/25---172.16.2.0/25
R6-R11骨干:172.16.2.000000 00/30---172.16.2.0/30

R11-R12骨干:172.16.2.000001 00/30 ---172.16.2.4/30
172.16.2.1 0000000/25---172.16.2.128/25
R11環(huán)回:172.16.2.1 00 00000/27---172.16.2.128/27

172.16.2.1 01 00000/27---172.16.2.160/27

L0:172.16.2.101 0 0000/28---172.16.2.160/28

L1:172.16.2.101 1 0000/28---172.16.2.176/28

172.16.00000011.0/24----172.16.3.0/24(Area 3)

兩骨干+兩環(huán)回: 172.16.3.0 0000000/25---172.16.3.0/25

172.16.3.00 000000/26---172.16.3.0/26
R7-R8骨干:172.16.3.0/30

172.16.3.01 000000/26---172.16.3.64/26
R8-R9骨干:172.16.3.64/30

172.16.3.1 0000000/25---172.16.3.128/25
R8環(huán)回:172.16.3.10 000000---172.16.3.128/26
R9環(huán)回:172.16.3.11 000000---172.16.3.192/26

172.16.00000100.0/24----172.16.4.0/24(Area 4)
172.16.4.0 0000000/25---172.16.4.0/25

R9-R10骨干:172.16.4.000000 00/30---172.16.4.0/30

172.16.4.1 000000/25---172.16.4.128/25

172.16.4.10 000000/26---172.16.4.128/26

172.16.4.11 000000/26---172.16.4.192/26

R9環(huán)回:172.16.4.128/26

R10環(huán)回:172.16.4.192/26

2、 路由器IP地址的配置

R1:

<Huawei>sys

[R1]int g 0/0/0

[R1-GigabitEthernet0/0/0]ip ad 172.16.0.1 29

[R1]int l0

[R1-LoopBack0]ip ad 172.16.0.65 26

R2:

<Huawei>sys

[Huawei]int g 0/0/0

[Huawei-GigabitEthernet0/0/0]ip ad 172.16.0.2 29

[Huawei-GigabitEthernet0/0/0]int l0

[Huawei-LoopBack0]ip ad 172.16.0.129 26

R3:

<Huawei>SYS

[R3]int g 0/0/0

[R3-GigabitEthernet0/0/0]ip ad 172.16.0.3 29

[R3-GigabitEthernet0/0/0]int l0

[R3-LoopBack0]ip ad 172.16.0.1 27

[R3-Serial4/0/0]ip ad 34.0.0.3 24

[R3-Tunnel0/0/0]ip ad 172.16.0.163 27

R4:

<Huawei>sys

[Huawei]sys R4-ISP

[Huawei]int s 4/0/0

[Huawei-Serial4/0/0]ip add 34.0.0.4 24

[Huawei-Serial4/0/0]int s 4/0/1

[Huawei-Serial4/0/1]int s 3/0/0

[Huawei-Serial3/0/0]ip ad 46.0.0.3 24

[Huawei-Serial3/0/0]int s 3/0/1

[Huawei-Serial3/0/1]ip ad 47.0.0.3 24

[Huawei]int l0

[Huawei-LoopBack0]ip ad 172.16.0.33 27

[Huawei-LoopBack0]int t 0/0/0

[Huawei-Tunnel0/0/0]ip ad 172.16.0.164 27

R5:

<Huawei>sys

Huawei]int s 4/0/0

[Huawei-Serial4/0/0]ip ad 45.0.0.5 24

[Huawei-Serial4/0/0]int tunn 0/0/0

[Huawei-Tunnel0/0/0]ip ad 172.16.0.165 27

[Huawei-Tunnel0/0/0]int l0

[Huawei-LoopBack0]ip ad 172.16.0.65 27

R6:

<Huawei>SYS

[Huawei]SYS R6

[R6]int s4/0/0

[R6-Serial4/0/0]ip ad 46.0.0.6 24

[R6-Serial4/0/0]int tu 0/0/0

[R6-Tunnel0/0/0]ip ad 172.16.0.166 27

[R6-Tunnel0/0/0]int l0

[R6-LoopBack0]ip ad 172.16.0.65 27

[R6]INT G 0/0/0

[R6-GigabitEthernet0/0/0]ip ad 172.16.2.1 30

R7:

[Huawei]sys R7

[R7]int s 4/0/0

[R7-Serial4/0/0]ip ad 47.0.0.7 24

[R7-Serial4/0/0]int l0

[R7-LoopBack0]ip ad 172.16.0.129 27

[R7-LoopBack0]int g 0/0/0

[R7-GigabitEthernet0/0/0]ip ad 172.16.3.1 30

[R7-GigabitEthernet0/0/0]int tu 0/0/0

[R7-Tunnel0/0/0]ip ad 172.16.0.167 27

R8:

<Huawei>SYS

[Huawei]sys R8

[R8]int g 0/0/0

[R8-GigabitEthernet0/0/0]ip ad 172.16.3.2 30

[R8-GigabitEthernet0/0/0]int g 0/0/1

[R8-GigabitEthernet0/0/1]ip ad 172.16.3.65 30

[R8-GigabitEthernet0/0/1]int l0

[R8-LoopBack0]ip ad 172.16.3.129 26

R9:

<Huawei>sys

[Huawei]sys R9

R9]int g 0/0/0

[R9-GigabitEthernet0/0/0]ip ad 172.16.3.66 30

[R9-GigabitEthernet0/0/0]int l0

[R9-LoopBack0]ip ad 172.16.3.193 26

[R9-LoopBack0]int g 0/0/1

[R9-GigabitEthernet0/0/1]ip ad 172.16.4.1 30

R10:

<Huawei>sys

[Huawei]sys R10

[R10]int g 0/0/0

[R10-GigabitEthernet0/0/0]ip ad 172.16.4.2 30

[R10-GigabitEthernet0/0/0]int l0

[R10-LoopBack0]ip ad 172.16.4.129 25

R11:

<Huawei>sys

[Huawei]sys R11

[R11]int g 0/0/0

[R11-GigabitEthernet0/0/0]ip ad 172.16.2.2 30

[R11]int l0

[R11-LoopBack0]ip ad 172.16.2.129 27

R12:

<Huawei>sys

[Huawei]sys R12

[R12]int g 0/0/0

[R12-GigabitEthernet0/0/0]ip ad 172.16.2.6 30

[R12-GigabitEthernet0/0/0]int l0

[R12-LoopBack0]ip ad 172.16.2.161 28

[R12-LoopBack0]int l1

[R12-LoopBack1]ip ad 172.16.2.177 28

3、 公網(wǎng)互通(靜態(tài)路由的配置)

[R3]ip route-static 0.0.0.0 0 34.0.0.4

[R5]ip route-static 0.0.0.0 0 45.0.0.4

[R6]ip route-static 0.0.0.0 0 46.0.0.3

[R7]ip route-static 0.0.0.0 0 47.0.0.3

公網(wǎng)通截圖:

image.png
image.png

4、 配置各個(gè)區(qū)域的OSPF以及RIP

R1:

[R1]ospf 1 router-id 1.1.1.1

[R1-ospf-1-area-0.0.0.1]network 172.16.0.0 0.0.0.63

[R1-ospf-1-area-0.0.0.1]network 172.16.0.0 0.0.0.7

R2:

[R2]ospf 1 router-id 2.2.2.2

[R2-ospf-1]area 1

[R2-ospf-1-area-0.0.0.1]net

[R2-ospf-1-area-0.0.0.1]network 172.16.0.0 0.0.0.7

[R2-ospf-1-area-0.0.0.1]network 172.16.0.128 0.0.0.63

R3:

[R3]ospf 1 router-id 3.3.3.3

[R3-ospf-1]area 1

[R3-ospf-1-area-0.0.0.1]net

[R3-ospf-1-area-0.0.0.1]network 172.16.0.3 0.0.0.0

[R3-ospf-1-area-0.0.0.1]network 172.16.0.10 0.0.0.0

[R3-ospf-1]area 0

[R3-ospf-1-area-0.0.0.0]network 172.16.0.160 0.0.0.63

R5:

[R5]ospf 1 rou 5.5.5.5

[R5-ospf-1]area 0

[R5-ospf-1-area-0.0.0.0]network 172.16.0.160 0.0.0.63

[R5-ospf-1-area-0.0.0.0]network 172.16.0.64 0.0.0.63

R6:

[R6]ospf 1 router-id 6.6.6.6

[R6-ospf-1]area 0

[R6-ospf-1-area-0.0.0.0]network 172.16.0.160 0.0.0.63

[R6-ospf-1]area 2

[R6-ospf-1-area-0.0.0.2]net

[R6-ospf-1-area-0.0.0.2]network 172.16.2.0 0.0.0.3

[R6-ospf-1-area-0.0.0.2]network 172.16.2.96 0.0.0.31

R7:

[R7]ospf 1 router-id 7.7.7.7

[R7-ospf-1]area 0

[R7-ospf-1-area-0.0.0.0]network 172.16.0.160 0.0.0.63

[R7-ospf-1]area 3

[R7-ospf-1-area-0.0.0.3]network 172.16.0.128 0.0.0.31

[R7-ospf-1-area-0.0.0.3]network 172.16.0.129 0.0.0.0

[R7-ospf-1-area-0.0.0.3]network 172.16.3.0 0.0.0.3

R8:

[R8]ospf 1 router-id 8.8.8.8

[R8-ospf-1]area 3

[R8-ospf-1-area-0.0.0.3]net

[R8-ospf-1-area-0.0.0.3]network 172.16.3.0 0.0.0.3

[R8-ospf-1-area-0.0.0.3]network 172.16.3.64 0.0.0.3

[R8-ospf-1-area-0.0.0.3]net

[R8-ospf-1-area-0.0.0.3]network 172.16.3.128 0.0.0.63

R9:

[R9]ospf 1 router-id 9.9.9.9

[R9-ospf-1]area 3

[R9-ospf-1-area-0.0.0.3]net

[R9-ospf-1-area-0.0.0.3]network 172.16.3.64 0.0.0.3

[R9-ospf-1-area-0.0.0.3]network 172.16.4.128 0.0.0.63

[R9]ospf 2 router-id 9.9.9.9

[R9-ospf-2]area 4

[R9-ospf-2-area-0.0.0.4]net

[R9-ospf-2-area-0.0.0.4]network 172.16.4.0 0.0.0.3

R10:

[R10]ospf 2 rou

[R10]ospf 2 router-id 10.10.10.10

[R10-ospf-2]area 4

[R10-ospf-2-area-0.0.0.4]net

[R10-ospf-2-area-0.0.0.4]network 172.16.4.0 0.0.0.3

[R10-ospf-2-area-0.0.0.4]network 172.16.4.192 0.0.0.63

R11:

[R11]ospf 1 router-id 11.11.11.11

[R11-ospf-1]area 2

[R11-ospf-1-area-0.0.0.2]net

[R11-ospf-1-area-0.0.0.2]network 172.16.2.0 0.0.0.3

[R11-ospf-1-area-0.0.0.2]network 172.16.2.4 0.0.0.3

[R11-ospf-1-area-0.0.0.2]net

[R11-ospf-1-area-0.0.0.2]network 172.16.2.128 0.0.0.31

R12:

[R12]rip

[R12-rip-1]version 2

[R12-rip-1]undo summary

[R12-rip-1]network 172.16.0.0

[R12-rip-1]q

[R12]ospf 2 router-id 12.12.12.12

[R12-ospf-2]area 2

[R12-ospf-2-area-0.0.0.2]net

[R12-ospf-2-area-0.0.0.2]network 172.16.2.4 0.0.0.3

5、 配置MGRE

R3:

[R3]int t 0/0/0

[R3-Tunnel0/0/0]tunnel-protocol gre p2mp

[R3-Tunnel0/0/0]source 34.0.0.3

[R3-Tunnel0/0/0]nhrp entry multicast dynamic

[R3-Tunnel0/0/0]nhrp network-id 100

[R3-Tunnel0/0/0]undo rip split-horizon

[R3-Tunnel0/0/0]ospf network-type broadcast

image.png
image.png

6、 全網(wǎng)通

image.png
image.png
image.png

Ping通測試:
image.png
image.png

7、 全網(wǎng)可訪問R4環(huán)回(acl)

R3:

[R3]acl 2000

[R3-acl-basic-2000] rule permit source 172.16.1.0 0.0.0.255

[R3]int s 4/0/0

[R3-Serial4/0/0]nat outbound 2000

R6:

[R6]acl 2000

[R6-acl-basic-2000] rule permit source 172.16.2.0 0.0.0.255

[R6]int s 4/0/0

[R6-Serial4/0/0]nat outbound 2000

R7:

[R7]acl 2000

[R7-acl-basic-2000] rule permit source 172.16.3.0 0.0.0.255

[R7]int s 4/0/0

[R7-Serial4/0/0]nat outbound 2000

Ping通測試:

image.png
image.png
image.png

8、 減少LSA的更新量(區(qū)域匯總)

R3:

[R3-ospf-1-area-0.0.0.1]abr-summary 172.16.1.0 255.255.255.0

R6:

[R6-ospf-1-area-0.0.0.2]abr-summary 172.16.2.0 255.255.255.0

R7:

[R7-ospf-1-area-0.0.0.]abr-summary 172.16.3.0 255.255.255.0

R9:

[R9-ospf-2] asbr-summary 172.16.4.0 255.255.255.0

R12:

[R12-ospf-1]asbr-summary 172.16.2.160 255.255.255.224

image.png

9、 減少路由表路由(特殊區(qū)域的劃分)

Area1:

[R1-ospf-1-area-0.0.0.1] stub no-summary

[R2-ospf-1-area-0.0.0.1] stub no-summary

[R3-ospf-1-area-0.0.0.1] stub no-summary

Area2:

[R6-ospf-1-area-0.0.0.2]nssa no-summary

[R11-ospf-1-area-0.0.0.2]nssa no-summary

[R12-ospf-1-area-0.0.0.2]nssa no-summary

Area3:

[R7-ospf-1-area-0.0.0.3]nssa no-summary

[R8-ospf-1-area-0.0.0.3]nssa no-summary

[R9-ospf-1-area-0.0.0.3]nssa no-summary

由于Area4是域外路由,因此不給劃分特殊區(qū)域,因其他三區(qū)域劃分了特殊區(qū)域,導(dǎo)致其他區(qū)域主機(jī)訪問Area4的主機(jī)時(shí)不會收到回包,因此給Area4下發(fā)一條缺?。?/p>

[R9-ospf-2]default-route-advertise always

路由表只剩下LSA1和LSA2以及缺省,精簡后:

image.png
image.png
image.png

10、 加快路由條目的收斂(修改Hello報(bào)文的更新時(shí)間為5s)

Area1:

[R1-GigabitEthernet0/0/0]ospf timer hello 5

[R2-GigabitEthernet0/0/0]ospf timer hello 5

[R3-GigabitEthernet0/0/0]ospf timer hello 5

Area2:

[R6-GigabitEthernet0/0/0]ospf timer hello 5

[R11-GigabitEthernet0/0/0]ospf timer hello 5

[R11-GigabitEthernet0/0/1]ospf timer hello 5

[R12-GigabitEthernet0/0/0]ospf timer hello 5

Area3:

[R7-GigabitEthernet0/0/0]ospf timer hello 5

[R8-GigabitEthernet0/0/0]ospf timer hello 5

[R8-GigabitEthernet0/0/1]ospf timer hello 5

[R9-GigabitEthernet0/0/0]ospf timer hello 5

Area4:

[R9-GigabitEthernet0/0/1]ospf timer hello 5

[R10-GigabitEthernet0/0/0]ospf timer hello 5

11、 保障更新安全(接口認(rèn)證—md5)

Area1(MD5):

[R1-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 123

[R2-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 123

[R3-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 123

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容