路由器配置——靜態路由-回環地址測試


一、實驗目的: 使用靜態路由協議實現全網互通

二、拓撲圖如下:

三、具體操作步驟:

R1路由器配置

Router>en  --進入特權模式
Router#conf t  --進去全局配置模式
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R1  --修改路由器名為R1
R1(config)#interface s0/0/0  --進入端口
R1(config-if)#ip address 192.168.12.1 255.255.255.0  --為端口配置地址
R1(config-if)#clock rate 6400  -- 配置的DCE串口,設置同步時間
Unknown clock rate  
R1(config-if)#no shutdown  --開啟端口

%LINK-5-CHANGED: Interface Serial0/0/0, changed state to down
R1(config-if)#interface l0  --進入L0虛擬端口(循環地址)

R1(config-if)#ip address 192.168.1.1 255.255.255.0  --配置地址
R1(config-if)#exit  --返回上一級
R1(config)#ip route 0.0.0.0 0.0.0.0 192.168.12.2  --配置缺省路由
R1(config)#end  --返回特權模式

R2路由器配置

Router>en  --進入特權模式
Router#conf t  --進入全局配置模式
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R2  --修改路由器名為R2
R2(config)#interface s0/0/0  --進入端口
R2(config-if)#ip address 192.168.12.2 255.255.255.0  --配置端口地址
R2(config-if)#clock rate 6400  --配置DCE串口,設置同步時間
Unknown clock rate
R2(config-if)#no shutdown  --開啟端口

R2(config-if)#interface s0/0/1  --進入端口
R2(config-if)#ip address 192.168.23.1 255.255.255.0  --配置端口地址
R2(config-if)#clock rate 6400  --配置DCE串口,設置同步時間
Unknown clock rate
R2(config-if)#no shutdown  --開啟端口

%LINK-5-CHANGED: Interface Serial0/0/1, changed state to down
R2(config-if)#interface l0  --進入L0虛擬端口(循環地址)

R2(config-if)#ip address 192.168.2.1 255.255.255.0  --配置端口地址
R2(config-if)#exit  --返回上一級
R2(config)#ip route 192.168.1.0 255.255.255.0 192.168.12.1  --配置靜態路由,上一跳地址R1
R2(config)#ip route 192.168.3.0 255.255.255.0 192.168.23.2  --配置靜態路由,下一條地址R3
R2(config)#end  --返回特權模式

R3路由器配置

Router>en  --進入特權模式
Router#conf t  --進入全局配置模式
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R3  --修改路由器名為R3
R3(config)#interface s0/0/0  --進入端口
R3(config-if)#ip address 192.168.23.2 255.255.255.0  --配置端口地址
R3(config-if)#no shutdown  --開啟端口

R3(config-if)#interface l0  --進入虛擬端口L0(循環地址)

R3(config-if)#ip address 192.168.3.1 255.255.255.0  --配置端口地址
R3(config-if)#exit  --返回上一級
R3(config)#ip route 0.0.0.0 0.0.0.0 192.168.23.1  --配置缺省路由
R3(config)#end  --返回特權模式

四、驗證:

(1)查看R1路由表信息

# show iproute

R1#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, 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.12.2 to network 0.0.0.0

C 192.168.1.0/24 is directly connected, Loopback0
C 192.168.12.0/24 is directly connected, Serial0/0/0
S* 0.0.0.0/0 [1/0] via 192.168.12.2
R1#

(2)互R1R3ping虛擬地址,看是否全網互通

# ping 192.168.3.1

R1#ping 192.168.3.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.3.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 6/9/14 ms

# ping 192.168.1.1

R3#ping 192.168.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 2/7/10 ms

全網互通成功


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM