路由器静态路由的配置

一·实验设备:两台Route-PT,两台Switch 2950-24, 两台PC ,一根Serial DCE线,四根直通线

二·目的:使不同网段下的主机可以互相通信

三·流程

连接如下如图所示


路由器静态路由的配置_第1张图片

Serial DCE线连接的是路由器的serial口

R1:

Router>

Router>en

Router#conf t

Router(config)#hostname R1

R1(config)#interface fa0/0

R1(config-if)#no shutdown

R1(config-if)#ip address 192.168.1.1 255.255.255.0

R1(config-if)#exit

R1(config)#interface serial 0/1/0 //连线要使用 DCE 端,路由器的串行电

缆一端是 DCE 端,另外一端是 DTE 端

R1(config-if)#no shutdown

R1(config-if)#clock rate 64000 //时钟频率必须在 DCE 端设置

R1(config-if)#ip address 192.168.5.2 255.255.255.0

R1(config-if)#exit

R1(config)#ip route 192.168.2.0 255.255.255.0 192.168.5.3

(静态路由配置命令)

R1#show ip route

C 192.168.1.0/24 is directly connected, FastEthernet0/0

S 192.168.2.0/24 [1/0] via 192.168.5.3

C 192.168.5.0/24 is directly connected, Serial0/1/0


R2:

Router>en

Router#conf t

Router(config)#hostname R2

R2(config)#interface fa0/0

R2(config-if)#no shutdown

R2(config-if)#ip address 192.168.2.1 255.255.255.0

R2(config-if)#exit网络技术 路由器静态路由的配置 王海峰

R2(config)#interface serial 0/1/0

R2(config-if)#no shutdown

R2(config-if)#ip address 192.168.5.3 255.255.255.0

R1(config-if)#exit

R2(config)#ip route 192.168.1.0 255.255.255.0 192.168.5.2

(静态路由配置命令)

R2#show ip route

S 192.168.1.0/24 [1/0] via 192.168.5.2

C 192.168.2.0/24 is directly connected, FastEthernet0/0

C 192.168.5.0/24 is directly connected, Serial0/1/0

测试:

PC>ping 192.168.2.2

Pinging 192.168.2.2 with 32 bytes of data:

Reply from 192.168.2.2: bytes=32 time=141ms TTL=126

Reply from 192.168.2.2: bytes=32 time=156ms TTL=126

Reply from 192.168.2.2: bytes=32 time=156ms TTL=126

Reply from 192.168.2.2: bytes=32 time=157ms TTL=126

Ping statistics for 192.168.2.2:

Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

Minimum = 141ms, Maximum = 157ms, Average = 152ms

你可能感兴趣的:(路由器静态路由的配置)