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

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

2、拓撲圖以下:spa

3、具體操做步驟:blog

R1路由器配置ip

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  --返回特權模式it

R2路由器配置io

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  --開啓端口ast

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  --開啓端口mobile

%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  --返回特權模式

4、驗證:

(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

全網互通成功

相關文章
相關標籤/搜索