![四、配置静态路由_CCNA](https://s2.51cto.com/attachment/200811/200811181226966758171.jpg?x-oss-process=image/resize,m_fixed,w_1184)
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R1
R1(config)#interface serial 2/0//进入S2/0
R1(config-if)#ip address 192.168.10.1 255.255.255.0//接口配置ip
R1(config-if)#no shutdown//激活接口
R1(config-if)#exit
R1(config)#ip route 192.168.20.0 255.255.255.0 Serial2/0//访问20网段的路由指向R2
R1(config)#exit
%SYS-5-CONFIG_I: Configured from console by console
R1#writ
Destination filename [startup-config]?
Building configuration...
[OK]
R1#
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R2
R2(config)#interface serial 2/0
R2(config-if)#ip address 192.168.10.2 255.255.255.0
R2(config-if)#no shutdown//激活接口,此时本口与对端口处于up状态
R2(config-if)#clock rate 64000//设置时钟频率为64000
R2(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/0, changed state to up
R2(config-if)#exit
R2(config)#interface serial 3/0
R2(config-if)#ip address 192.168.20.1 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#clock rate 64000
R2(config-if)#exit
R2(config)#exit
%SYS-5-CONFIG_I: Configured from console by console
R2#write
Destination filename [startup-config]?
Building configuration...
[OK]
R2#
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R3
R3(config)#interface serial 2/0
R3(config-if)#ip address 192.168.20.2 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/0, changed state to up
R3(config-if)#exit
R3(config)#exit
%SYS-5-CONFIG_I: Configured from console by console
R3#write
Destination filename [startup-config]?
Building configuration...
[OK]
R3#
Sending 5, 100-byte ICMP Echos to 192.168.10.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 68/79/104 ms
Sending 5, 100-byte ICMP Echos to 192.168.10.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 34/39/45 ms
Sending 5, 100-byte ICMP Echos to 192.168.20.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 34/37/42 ms
Sending 5, 100-byte ICMP Echos to 192.168.20.2, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
Sending 5, 100-byte ICMP Echos to 192.168.20.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 69/77/88 ms//此时ping通