实验目的:
R1到R2静态路由实现源:LO:1.1.1.1 ping 目的:LO:2.2.2.2
拓扑:
R1
interface Loopback0
ip address 1.1.1.1255.255.255.0
interface Serial1/0
ip address 202.100.1.1255.255.255.0
no shutdown
ip route 2.2.2.0 255.255.255.0 202.100.1.2
R2
interface Loopback0
ip address 2.2.2.2 255.255.255.0
interface Serial1/0
ip address 202.100.1.2 255.255.255.0
no shutdown
ip route 0.0.0.0 0.0.0.0 202.100.1.1
查看路由表
R1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRPexternal, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA externaltype 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type1, E2 - OSPF external type 2
i - IS-IS, su - IS-ISsummary, 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 - periodicdownloaded static route
Gateway of last resort is not set
1.0.0.0/24 is subnetted,1 subnets
C 1.1.1.0 is directlyconnected, Loopback0
2.0.0.0/24 is subnetted,1 subnets
S 2.2.2.0 [1/0] via 202.100.1.2
C 202.100.1.0/24 isdirectly connected, Serial1/0
R2
R2#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRPexternal, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA externaltype 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type1, 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 - periodicdownloaded static route
Gateway of last resort is 202.100.1.1 to network 0.0.0.0
2.0.0.0/24 is subnetted,1 subnets
C 2.2.2.0 is directlyconnected, Loopback0
C 202.100.1.0/24 isdirectly connected, Serial1/0
S* 0.0.0.0/0 [1/0] via 202.100.1.1
测试
R1
R1#ping 2.2.2.2 source 1.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/35/76ms
R2
R2# ping 1.1.1.1 source 2.2.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
Packet sent with a source address of 2.2.2.2
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/36/56ms
关于DCE/DTE
DCE(data Circuit-terminating equipment)即数据通信设备
DTE(data terminal equipment)数据终端设备
DTE:数据终端设备。如指一般的终端或是计算机。可能是大、中、小型计算机,也可能是一台只接收数据的打印机
对于路由器的串口来说是有DCE和DTE之分的。在DCE端是要配置clockrate的。因为串行通信是要同一时钟的,否则这边开始发送了,那边还没开始收。
路由器通常是DTE设备,modem、GV转换器等等传输设备通常被规定为DCE
比如一台路由器,它处于网络的边缘,它有一个S0口需要从另一台路由器中学习到一些参数,具体实施时,我们就不需在这个S0口配“时钟速率”,它从对方学到。这时它就是DTE,而对方就是DCE
当路由器作为DCE用来提供时钟频率时是需要设置的
做路由器的背靠背实验时两个路由器一个做为DCE一个做为DTE,做DCE的需要配置clock rate
ISDN用64000,或是分时隙的用64000,只有普通拨号串口用56000,设定好DTE,DCE,DTE,DCE的时钟速率要一致
如果不能确定哪台路由器拥有这条线缆的DTE端,哪台路由器拥有DCE端,可以利用showcontroller serial 0来确定 DCE一方提供时钟,DTE不提供时钟,但它依靠DCE提供的时钟工作。比如PC机和MODEM之间的连接。PC机就是一个DTE,MODEM是一个DCE
同步通信都要有时钟进行同步的,配置时钟频率就要告诉这个端口是以自身的时钟为准,还是取线路时钟,或者取外部的DTE时钟。只有确立的同步方式,串口才可以好好的工作,否则不是不通,就是乱码,用不了的!
在同步通信里,都必须有的,而异步通信就以校验,停止位为特点进行数据传输。现在IP接口的路由器大为应用,这样通过串口进行联网的都很少了