溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

網(wǎng)絡(luò)必備——?jiǎng)討B(tài)路由(默認(rèn)路由+靜態(tài)+OSPF+RIP綜合實(shí)驗(yàn))

發(fā)布時(shí)間:2020-07-15 06:37:16 來(lái)源:網(wǎng)絡(luò) 閱讀:999 作者:23trl 欄目:云計(jì)算

網(wǎng)絡(luò)必備——?jiǎng)討B(tài)路由(默認(rèn)路由+靜態(tài)+OSPF+RIP綜合實(shí)驗(yàn))

本章目的:全網(wǎng)互通,R2設(shè)置靜態(tài)路由,R2和R3在AREA1區(qū)域中使用OSPF協(xié)議 ,R3設(shè)置默認(rèn)路由回來(lái),R4和R5使用RIP協(xié)議

本章環(huán)境:GNS3,5臺(tái)路由器,4臺(tái)主機(jī),1個(gè)外部網(wǎng).

實(shí)驗(yàn)圖:

網(wǎng)絡(luò)必備——?jiǎng)討B(tài)路由(默認(rèn)路由+靜態(tài)+OSPF+RIP綜合實(shí)驗(yàn))

  1. 路由器接口地址
R1:
f0/0(192.168.10.1/24)
f0/1(192.168.20.1/24)
R2:
f0/1(192.168.20.2/24)
f0/0(192.168.30.1/24)
R3:
f0/0(192.168.30.2/24)
f0/1(192.168.40.1/24)
f1/0(12.0.0.1/24)
f2/0(192.168.70.1/24)
R4:
f0/1(192.168.50.1/24)
f0/0(192.168.40.2/24)
R6:
f0/1(192.168.60.1/24)
f0/0(192.168.50.2/24)

2.外部網(wǎng)地址:

R5:
f0/0(12.0.0.2/24)
f0/1(13.0.0.1/24)

3.客戶端地址:

PC機(jī)1:(192.168.10.2/24)
PC機(jī)2:(192.168.70.2/24)
PC機(jī)3:(13.0.0.13/24)  
PC機(jī)4:(192.168.60.2/24)

R3的路由器要多加一塊單板

網(wǎng)絡(luò)必備——?jiǎng)討B(tài)路由(默認(rèn)路由+靜態(tài)+OSPF+RIP綜合實(shí)驗(yàn))

1.配置R1路由器

R1#conf t   //進(jìn)入全局模式
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#int f0/0  //進(jìn)入接口
R1(config-if)#ip add 192.168.10.1 255.255.255.0   //設(shè)置地址
R1(config-if)#no shut   //開(kāi)啟
R1(config-if)#ex
R1(config)#int f0/1
R1(config-if)#ip add 192.168.20.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#ex
R1(config)#do show ip route  //查看路由表
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is 192.168.20.2 to network 0.0.0.0

C    192.168.10.0/24 is directly connected, FastEthernet0/0  //直連網(wǎng)段
C    192.168.20.0/24 is directly connected, FastEthernet0/1  //直連網(wǎng)段
S*   0.0.0.0/0 [1/0] via 192.168.20.2    //默認(rèn)網(wǎng)絡(luò)

2.配置R2路由器接口地址

R2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#int f0/1
R2(config-if)#ip add 192.168.20.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#ex   
R2(config)#int f0/0
R2(config-if)#ip add 192.168.30.1 255.255.255.0
R2(config-if)#no shut
R2(config-if)#ex

3.配置R2靜態(tài)路由和OSPF協(xié)議

R2(config)#router ospf 1  //進(jìn)入OSPF協(xié)議1進(jìn)程  在協(xié)議里一定要在同一個(gè)進(jìn)程
R2(config-router)#router-id 2.2.2.2   //設(shè)置路由器router-id
R2(config-router)#network 192.168.30.0 0.0.0.255 area 1  //宣告30網(wǎng)段再骨干區(qū)域area1中
R2(config-router)#redistribute connected subnets    //將R2直連的網(wǎng)段注入進(jìn)來(lái)
R2(config-router)#redistribute static subnets          //將 靜態(tài)路由的10網(wǎng)段注入進(jìn)來(lái)
R2(config-router)#ex
R2(config)#ip route 192.168.10.0 255.255.255.0 192.168.20.1  //設(shè)置靜態(tài)路由 網(wǎng)段,子網(wǎng)掩碼,下一跳地址
R2(config)#do show ip route   
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

C    192.168.30.0/24 is directly connected, FastEthernet0/0
S    192.168.10.0/24 [1/0] via 192.168.20.1
C    192.168.20.0/24 is directly connected, FastEthernet0/1

4.配置R3接口地址

R3
R3#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R3(config)#int f0/0
R3(config-if)#ip add 192.168.30.2 255.255.255.0
R3(config-if)#no shut
R3(config-if)#int f0/1
R3(config-if)#ip add 192.168.40.1 255.255.255.0
R3(config-if)#no shut
R3(config-if)#int f1/0
R3(config-if)#ip add 12.0.0.1 255.255.255.0
R3(config-if)#no shut
R3(config-if)#int f2/0 
R3(config-if)#ip add 192.168.70.1 255.255.255.0
R3(config-if)#no shut
R3(config-if)#ex

5.配置R3默認(rèn)路由和OSPF協(xié)議

R3(config)#ip route 0.0.0.0 0.0.0.0 12.0.0.2  將R3設(shè)置成默認(rèn)路由
R3(config)#router ospf 1   //開(kāi)啟OSPF進(jìn)程1
R3(config-router)#router-id 3.3.3.3  //設(shè)置路由router-id
R3(config-router)#network 192.168.30.0 0.0.0.255 area 1  宣告30網(wǎng)段在area 1區(qū)域中
R3(config-router)#network 192.168.40.0 0.0.0.255 area 0 宣告40網(wǎng)段在area 0區(qū)域中
R3(config-router)#network 192.168.70.0 0.0.0.255 area 0宣告70網(wǎng)段在area 0區(qū)域中
R3(config-router)#ex
R3(config)#do show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is 12.0.0.2 to network 0.0.0.0

C    192.168.30.0/24 is directly connected, FastEthernet0/0
O E2 192.168.10.0/24 [110/20] via 192.168.30.1, 00:00:49, FastEthernet0/0
C    192.168.40.0/24 is directly connected, FastEthernet0/1
O E2 192.168.20.0/24 [110/20] via 192.168.30.1, 00:00:49, FastEthernet0/0
     12.0.0.0/24 is subnetted, 1 subnets
C       12.0.0.0 is directly connected, FastEthernet1/0
C    192.168.70.0/24 is directly connected, FastEthernet2/0
S*   0.0.0.0/0 [1/0] via 12.0.0.2

6.配置R4接口地址

R4#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R4(config)#int f0/0
R4(config-if)#ip add 192.168.40.2 255.255.255.0
R4(config-if)#no shut
R4(config-if)#int f0/1
R4(config-if)#ip add 192.168.50.1 255.255.255.0
R4(config-if)#no shut
R4(config-if)#ex

7.配置R4RIP協(xié)議,注入OSPF協(xié)議

R4(config)#router rip  //進(jìn)入rip協(xié)議
R4(config-router)#ver 2    //使用2版本協(xié)議
R4(config-router)#no auto-summary   //關(guān)閉路由匯總
R4(config-router)#network 192.168.50.0   //宣告網(wǎng)段
R4(config-router)#redistribute ospf 1 metric 5  //在rip協(xié)議中注入OSPF協(xié)議
R4(config-router)#router ospf 1    //開(kāi)啟OSPF進(jìn)程1
R4(config-router)#router-id 4.4.4.4
R4(config-router)#network 192.168.40.0 0.0.0.255 area 0
R4(config-router)#redistribute rip subnets
R4(config-router)#ex
R4(config)#do show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is 192.168.40.1 to network 0.0.0.0

O IA 192.168.30.0/24 [110/20] via 192.168.40.1, 00:00:18, FastEthernet0/0
O E2 192.168.10.0/24 [110/20] via 192.168.40.1, 00:00:18, FastEthernet0/0
C    192.168.40.0/24 is directly connected, FastEthernet0/0
O E2 192.168.20.0/24 [110/20] via 192.168.40.1, 00:00:18, FastEthernet0/0
C    192.168.50.0/24 is directly connected, FastEthernet0/1
O    192.168.70.0/24 [110/11] via 192.168.40.1, 00:00:18, FastEthernet0/0
O*E2 0.0.0.0/0 [110/1] via 192.168.40.1, 00:00:18, FastEthernet0/0

8.配置R6接口地址

R6#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R6(config)#int f0/0
R6(config-if)#ip add 192.168.50.2 255.255.255.0
R6(config-if)#no shut
R6(config-if)#int f0/1
R6(config-if)#ip add 192.168.60.1 255.255.255.0
R6(config-if)#no shut
R6(config-if)#ex

9.配置R6RIP協(xié)議

R6(config)#router rip
R6(config-router)#ver 2
R6(config-router)#no auto-summary
R6(config-router)#network 192.168.50.0
R6(config-router)#network 192.168.60.0
R6(config-router)#ex   
R6(config)#do show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is 192.168.50.1 to network 0.0.0.0

R    192.168.30.0/24 [120/5] via 192.168.50.1, 00:00:21, FastEthernet0/0
C    192.168.60.0/24 is directly connected, FastEthernet0/1
R    192.168.10.0/24 [120/5] via 192.168.50.1, 00:00:21, FastEthernet0/0
R    192.168.40.0/24 [120/5] via 192.168.50.1, 00:00:21, FastEthernet0/0
R    192.168.20.0/24 [120/5] via 192.168.50.1, 00:00:21, FastEthernet0/0
C    192.168.50.0/24 is directly connected, FastEthernet0/0
R    192.168.70.0/24 [120/5] via 192.168.50.1, 00:00:21, FastEthernet0/0
R*   0.0.0.0/0 [120/1] via 192.168.50.1, 00:00:22, FastEthernet0/0

10.配置R5外部網(wǎng)默認(rèn)路由,和接口地址

R5R5#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R5(config)#ip route 192.168.0.0 255.255.0.0 12.0.0.1  //設(shè)置成默認(rèn)路由
R5(config)#int f0/0
R5(config-if)#ip add 12.0.0.2 255.255.255.0
R5(config-if)#no shut
R5(config-if)#int f0/1
R5(config-if)#ip add 13.0.0.1 255.255.255.0
R5(config-if)#no shut
R5(config-if)#ex
R5(config)#do show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     12.0.0.0/24 is subnetted, 1 subnets
C       12.0.0.0 is directly connected, FastEthernet0/0
     13.0.0.0/24 is subnetted, 1 subnets
C       13.0.0.0 is directly connected, FastEthernet0/1
S    192.168.0.0/16 [1/0] via 12.0.0.1

11.給四臺(tái)主機(jī)配好地址

PC1> ip 192.168.10.2 192.168.10.1
Checking for duplicate address...
PC1 : 192.168.10.2 255.255.255.0 gateway 192.168.10.1

PC2> ip 192.168.70.2 192.168.70.1
Checking for duplicate address...
PC1 : 192.168.70.2 255.255.255.0 gateway 192.168.70.1

PC3> ip 13.0.0.13 13.0.0.1
Checking for duplicate address...
PC1 : 13.0.0.13 255.255.255.0 gateway 13.0.0.1

PC號(hào)主機(jī)> ip 192.168.60.2 192.168.60.1
Checking for duplicate address...
PC1 : 192.168.60.2 255.255.255.0 gateway 192.168.60.1

12.驗(yàn)證一下是不是全網(wǎng)互通

PC1> ping 192.168.70.2
192.168.70.2 icmp_seq=1 timeout
192.168.70.2 icmp_seq=2 timeout
84 bytes from 192.168.70.2 icmp_seq=3 ttl=61 time=62.159 ms
84 bytes from 192.168.70.2 icmp_seq=4 ttl=61 time=62.159 ms
84 bytes from 192.168.70.2 icmp_seq=5 ttl=61 time=66.171 ms

PC1> ping 13.0.0.13
13.0.0.13 icmp_seq=1 timeout
13.0.0.13 icmp_seq=2 timeout
84 bytes from 13.0.0.13 icmp_seq=3 ttl=60 time=92.298 ms
84 bytes from 13.0.0.13 icmp_seq=4 ttl=60 time=92.248 ms
84 bytes from 13.0.0.13 icmp_seq=5 ttl=60 time=94.935 ms

PC1> ping 192.168.60.2
192.168.60.2 icmp_seq=1 timeout
84 bytes from 192.168.60.2 icmp_seq=2 ttl=59 time=112.913 ms
84 bytes from 192.168.60.2 icmp_seq=3 ttl=59 time=110.144 ms
84 bytes from 192.168.60.2 icmp_seq=4 ttl=59 time=116.545 ms
84 bytes from 192.168.60.2 icmp_seq=5 ttl=59 time=116.432 ms

以上就是我們的綜合實(shí)驗(yàn)了,下一章OSPF最后一個(gè)實(shí)驗(yàn)虛鏈路。

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI