一個(gè)OSPF綜合實(shí)驗(yàn),包括9臺(tái)路由器(其中一臺(tái)模擬幀中繼交換機(jī)),涉及OSPF多區(qū)域、OSPF虛鏈路、Stub區(qū)域、NSSA區(qū)域、OSPF手動(dòng)匯總、OSPF接口認(rèn)證、OSPF區(qū)域認(rèn)證等技術(shù)。
GNS3拓?fù)渑c實(shí)驗(yàn)拓?fù)鋱D完全一致,我把預(yù)配置文件也一起打包了(包括所有的接口配置以及幀中繼交換機(jī)的配置,在下邊),需要的可以直接下載專注于練習(xí)OSPF。
點(diǎn)擊下載:GNS3實(shí)驗(yàn)拓?fù)浼邦A(yù)配置文件
實(shí)驗(yàn)拓?fù)鋱D
實(shí)驗(yàn)過(guò)程:
1、幀中繼交換機(jī)的配置,我簡(jiǎn)單寫(xiě)一下(預(yù)配置已經(jīng)做好,跟OSPF關(guān)系不大)。
en
conf t
ho R9
frame-relay switching
int s1/0
encapsulation frame-relay
clock rate 64000
frame-relay intf-type dce
frame-relay route 203 interface s1/1 302
frame-relay route 204 interface s1/2 402
no sh
int s1/1
encapsulation frame-relay
clock rate 64000
frame-relay intf-type dce
frame-relay route 302 interface s1/0 203
no sh
int s1/2
encapsulation frame-relay
clock rate 64000
frame-relay intf-type dce
frame-relay route 402 interface s1/0 204
no sh
end
2、配置Area 0區(qū)域,不需要采用子接口,物理接口網(wǎng)絡(luò)類型設(shè)置為broadcast即可。
R2(config)#router ospf 10
R2(config-router)#router-id 2.2.2.2
R2(config-router)#network 172.17.1.1 0.0.0.0 area 0
// 修改OSPF接口網(wǎng)絡(luò)類型為廣播
R2(config-router)#int s1/2
R2(config-if)#ip ospf network broadcast
R3(config)#router ospf 10
R3(config-router)#router-id 3.3.3.3
R3(config-router)#network 172.17.1.2 0.0.0.0 area 0
// 修改OSPF接口網(wǎng)絡(luò)類型為廣播
R3(config-router)#int s1/2
R3(config-if)#ip ospf network broadcast
// 設(shè)置ospf接口優(yōu)先級(jí)為0,禁止R3成為DR/BDR
R3(config-if)#ip ospf priority 0
R4(config)#router ospf 10
R4(config-router)#router-id 4.4.4.4
R4(config-router)#network 172.17.1.3 0.0.0.0 area 0
// 修改OSPF接口網(wǎng)絡(luò)類型為廣播
R4(config-router)#int s1/2
R4(config-if)#ip ospf network broadcast
//設(shè)置ospf接口優(yōu)先級(jí)為0,禁止R4成為DR/BDR
R4(config-if)#ip ospf priority 0
3、在R2上檢查鄰居關(guān)系,R3和R4均為DROTHER
R2#sh ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
3.3.3.3 0 FULL/DROTHER 00:00:34 172.17.1.2 Serial1/2
4.4.4.4 0 FULL/DROTHER 00:00:33 172.17.1.3 Serial1/2
4、配置Area 1區(qū)域
R2(config)#router ospf 10
R2(config-router)#net 10.1.1.2 0.0.0.0 area 1
R1(config)#router ospf 10
R1(config-router)#router-id 1.1.1.1
R1(config-router)#net 172.16.0.0 0.0.3.255 area 1
R1(config-router)#net 10.1.1.1 0.0.0.0 area 1
5、配置Area 2區(qū)域
R4(config)#router ospf 10
R4(config-router)#net 10.1.3.1 0.0.0.0 area 2
R7(config)#router ospf 10
R7(config-router)#router-id 7.7.7.7
R7(config-router)#net 172.18.1.0 0.0.1.255 area 2
R7(config-router)#net 10.1.3.2 0.0.0.0 area 2
6、配置Area 3區(qū)域
R7(config)#router ospf 10
R7(config-router)#net 10.1.4.1 0.0.0.0 area 3
R8(config)#router ospf 10
R8(config-router)#router-id 8.8.8.8
R8(config-router)#net 172.20.0.0 0.0.3.255 area 3
R8(config-router)#net 10.1.4.2 0.0.0.0 area 3
7、配置Area 4區(qū)域
R3(config)#router ospf 10
R3(config-router)#net 10.1.2.1 0.0.0.0 area 4
R5(config)#router ospf 10
R5(config-router)#router-id 5.5.5.5
R5(config-router)#net 172.19.0.0 0.0.1.255 area 4
R5(config-router)#net 10.1.2.2 0.0.0.0 area 4
8、由于Area 3沒(méi)有跟Area 0直接相連,因此需要在R4和R7上創(chuàng)建虛鏈路
//虛鏈路參數(shù)為對(duì)端路由器Router ID
R4(config)#router ospf 10
R4(config-router)#area 2 virtual-link 7.7.7.7
R7(config)#router ospf 10
R7(config-router)#area 2 virtual-link 4.4.4.4
9、配置ripv2路由協(xié)議,由于rip不支持掩碼表示法,因此需要依次宣告每個(gè)C類網(wǎng)段
R5(config)#router rip
R5(config-router)#version 2
R5(config-router)#no auto-summary
R5(config-router)#net 192.168.255.0
R6(config)#router rip
R6(config-router)#version 2
R6(config-router)#no auto-summary
R6(config-router)#net 192.168.0.0
R6(config-router)#net 192.168.1.0
R6(config-router)#net 192.168.2.0
R6(config-router)#net 192.168.3.0
R6(config-router)#net 192.168.4.0
R6(config-router)#net 192.168.5.0
R6(config-router)#net 192.168.6.0
R6(config-router)#net 192.168.7.0
R6(config-router)#net 192.168.8.0
R6(config-router)#net 192.168.9.0
R6(config-router)#net 192.168.10.0
R6(config-router)#net 192.168.11.0
R6(config-router)#net 192.168.255.0
10、在R5上將rip重分布進(jìn)ospf,開(kāi)銷使用E1類型,此時(shí)R5為ASBR
R5(config)#router ospf 10
R5(config-router)#redistribute rip subnets metric-type 1
11、檢查R2的路由表,應(yīng)可以學(xué)到192.168.0.0/24網(wǎng)段
R2#sh ip ro
O E1 192.168.8.0/24 [110/148] via 172.17.1.2, 00:00:58, Serial1/2
O E1 192.168.9.0/24 [110/148] via 172.17.1.2, 00:00:58, Serial1/2
O E1 192.168.10.0/24 [110/148] via 172.17.1.2, 00:00:58, Serial1/2
172.17.0.0/24 is subnetted, 1 subnets
C 172.17.1.0 is directly connected, Serial1/2
172.16.0.0/24 is subnetted, 4 subnets
O 172.16.0.0 [110/65] via 10.1.1.1, 00:10:09, Serial1/0
O 172.16.1.0 [110/65] via 10.1.1.1, 00:10:09, Serial1/0
O 172.16.2.0 [110/65] via 10.1.1.1, 00:10:12, Serial1/0
O 172.16.3.0 [110/65] via 10.1.1.1, 00:10:12, Serial1/0
172.19.0.0/24 is subnetted, 2 subnets
O IA 172.19.1.0 [110/129] via 172.17.1.2, 00:06:38, Serial1/2
O IA 172.19.0.0 [110/129] via 172.17.1.2, 00:06:38, Serial1/2
172.18.0.0/24 is subnetted, 2 subnets
O IA 172.18.0.0 [110/129] via 172.17.1.3, 00:06:41, Serial1/2
O IA 172.18.1.0 [110/129] via 172.17.1.3, 00:06:41, Serial1/2
172.20.0.0/24 is subnetted, 4 subnets
O IA 172.20.0.0 [110/193] via 172.17.1.3, 00:06:41, Serial1/2
O IA 172.20.1.0 [110/193] via 172.17.1.3, 00:06:41, Serial1/2
O IA 172.20.2.0 [110/193] via 172.17.1.3, 00:06:41, Serial1/2
O IA 172.20.3.0 [110/193] via 172.17.1.3, 00:06:41, Serial1/2
O E1 192.168.11.0/24 [110/148] via 172.17.1.2, 00:01:04, Serial1/2
O E1 192.168.4.0/24 [110/148] via 172.17.1.2, 00:01:04, Serial1/2
O E1 192.168.5.0/24 [110/148] via 172.17.1.2, 00:01:04, Serial1/2
10.0.0.0/24 is subnetted, 4 subnets
O IA 10.1.3.0 [110/128] via 172.17.1.3, 00:06:41, Serial1/2
O IA 10.1.2.0 [110/128] via 172.17.1.2, 00:06:41, Serial1/2
C 10.1.1.0 is directly connected, Serial1/0
O IA 10.1.4.0 [110/192] via 172.17.1.3, 00:06:41, Serial1/2
O E1 192.168.6.0/24 [110/148] via 172.17.1.2, 00:01:04, Serial1/2
O E1 192.168.7.0/24 [110/148] via 172.17.1.2, 00:01:07, Serial1/2
O E1 192.168.255.0/24 [110/148] via 172.17.1.2, 00:01:07, Serial1/2
O E1 192.168.0.0/24 [110/148] via 172.17.1.2, 00:01:07, Serial1/2
O E1 192.168.1.0/24 [110/148] via 172.17.1.2, 00:01:07, Serial1/2
O E1 192.168.2.0/24 [110/148] via 172.17.1.2, 00:01:07, Serial1/2
O E1 192.168.3.0/24 [110/148] via 172.17.1.2, 00:01:07, Serial1/2
精彩內(nèi)容,請(qǐng)點(diǎn)擊下一頁(yè)!