静态路由的添加实验报告
一、
实验目的
环回接口或真实主机在不同网络间能够通信,以及环回接口与真实主机通信是
ping
命令的不同
二、
实验设备
三台
C1841
路由器、三台电脑、两根控制线、三根非屏蔽的交叉线、两根串行电缆
三、
实验拓扑
四、
实验要求
1.
能够对路由器配置环回接口,并且能给环回接口配地址
2.
通过
ip router
给路由器添加静态路由,并能通过
show
命令查看路由表的完整性
3.
当路由表不完整,环回接口与环回接口,主机与主机间不通时,会用相应的命令进行排错
五、
实验步骤
1.
准备好设备,用串行线缆路由器连接起来
2.
用一根控制线先连到路由器
R3
上,给路由器配置
Telnet
所需的配置
Router(config)#host R3
R3(config)#enable password 123
R3(config)#line vty 0 4
R3(config-line)#password 123
R3(config-line)#login
R3(config-line)#exi
R3(config)#inter f0/0
R3(config-if)#ip add 192.168.53.2 255.255.255.0
R3(config-if)#no shut
3.
两根控制线分别连到路由器
R1
和
R2
上,通过主机来配置
R1
,
R2
,
R3
通过
Telnet
来配置
R3
通过环回接口的配置:
R1
的配置:
R1(config)#inter l 0
R1(config-if)#ip add 192.168.51.1 255.255.255.0
R1(config-if)#inter s0/0/0
R1(config-if)#no shut
R1(config-if)#ip add 10.0.0 .1 255.255.255.252
R1(config-if)#clock rate 64000
R1(config)#ip route 192.168.53.0 255.255.255.0 s0/0/0
R1(config)#ip route 192.168.52.0 255.255.255.0 s0/0/0
查看路由表:
10.0.0 .0/30 is subnetted, 1 subnets
C 10.0.0 .0 is directly connected, Serial0/0/0
S 192.168.53.0/24 is directly connected, Serial0/0/0
S 192.168.52.0/24 is directly connected, Serial0/0/0
C 192.168.51.0/24 is directly connected, Loopback0
R2
的配置:
R2(config)#interface l 0
R2(config-if)#ip address 192.168.52.1 255.255.255.0
R2(config)#interface s0/0/0
R2(config-if)#clock rate 64000
R2(config-if)#ip address 10.0.0 .2 255.255.255.252
R2(config-if)#no shut
R2(config)#interface s0/0/1
R2(config-if)#ip address 10.0.0 .5 255.255.255.252
R2(config)#ip route 192.168.51.0 255.255.255.0 s0/0/0
R2(config)#ip route 192.168.53.0 255.255.255.0 s0/0/1
查看路由表:
10.0.0 .0/30 is subnetted, 2 subnets
C 10.0.0 .0 is directly connected, Serial0/0/0
C 10.0.0 .4 is directly connected, Serial0/0/1
S 192.168.53.0/24 is directly connected, Serial0/0/1
C 192.168.52.0/24 is directly connected, Loopback0
S 192.168.51.0/24 is directly connected, Serial0/0/0
R3
的配置:
R3(config)#inter l 0
R3(config-if)#ip add 192.168.53.1 255.255.255.0
R3(config)#inter s0/0/0
R3(config-if)#ip add 10.0.0 .6 255.255.255.252
R3(config-if)#clock rate 64000
R3(config)#ip route 192.168.51.0 255.255.255.0 s0/0/0
R3(config)#ip route 192.168.52.0 255.255.255.0 s0/0/0
查看路由表:
10.0.0 .0/30 is subnetted, 1 subnets
C 10.0.0 .4 is directly connected, Serial0/0/0
C 192.168.53.0/24 is directly connected, Loopback1
S 192.168.52.0/24 is directly connected, Serial0/0/0
S 192.168.51.0/24 is directly connected, Serial0/0/0
C 192.168.1.0/24 is directly connected, FastEthernet0/0
4.
测试环回接口所在网络间的通信
R1#ping 192.168.53.1 source 192.168.51.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.53.1, timeout is 2 seconds:
Packet sent with a source address of 192.168.51.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1484/1490/1496 ms
R1#ping 192.168.52.1 source 192.168.51.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.52.1, timeout is 2 seconds:
Packet sent with a source address of 192.168.51.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 28/28/32 ms
R2#ping 192.168.51.1 source 192.168.52.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.51.1, timeout is 2 seconds:
Packet sent with a source address of 192.168.52.2
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 28/28/28 ms
R3#ping 192.168.51.1 source 192.168.53.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.51.1, timeout is 2 seconds:
Packet sent with a source address of 192.168.53.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1492/1580/1920 ms
R3#ping 192.168.52.1 source 192.168.53.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.51.1, timeout is 2 seconds:
Packet sent with a source address of 192.168.53.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1492/1580/1920 ms
4.
把路由器上的环回接口
down
掉,有交叉线把主机与路由器相连,给把环回接口的地址给主机
R2(config)#int f0/0
R2(config-if)#ip add 192.168.51.2 255.255.255.0
R2(config)#int f0/0
R2(config-if)#ip add 192.168.52.2 255.255.255.0
5.
测试主机间是否能够通信
在主机
1
上的
ping
PC>ping 192.168.53.1
Pinging 192.168.53.1 with 32 bytes of data:
Reply from 192.168.53.1: bytes=32 time=125ms TTL=125
Reply from 192.168.53.1: bytes=32 time=125ms TTL=125
Reply from 192.168.53.1: bytes=32 time=125ms TTL=125
Reply from 192.168.53.1: bytes=32 time=125ms TTL=125
Ping statistics for 192.168.53.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 125ms, Maximum = 125ms, Average = 125ms
PC>ping 192.168.52.1
Pinging 192.168.52.1 with 32 bytes of data:
Request timed out.
Reply from 192.168.52.1: bytes=32 time=94ms TTL=126
Reply from 192.168.52.1: bytes=32 time=94ms TTL=126
Reply from 192.168.52.1: bytes=32 time=94ms TTL=126
Ping statistics for 192.168.52.1:
Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-seconds:
Minimum = 94ms, Maximum = 94ms, Average = 94ms
在主机
2
上的
ping
PC>ping 192.168.51.1
Pinging 192.168.51.1 with 32 bytes of data:
Reply from 192.168.51.1: bytes=32 time=78ms TTL=126
Reply from 192.168.51.1: bytes=32 time=78ms TTL=126
Reply from 192.168.51.1: bytes=32 time=93ms TTL=126
Reply from 192.168.51.1: bytes=32 time=94ms TTL=126
Ping statistics for 192.168.51.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 78ms, Maximum = 94ms, Average = 85ms
PC>ping 192.168.53.1
Pinging 192.168.53.1 with 32 bytes of data:
Reply from 192.168.53.1: bytes=32 time=94ms TTL=126
Reply from 192.168.53.1: bytes=32 time=78ms TTL=126
Reply from 192.168.53.1: bytes=32 time=94ms TTL=126
Reply from 192.168.53.1: bytes=32 time=94ms TTL=126
Ping statistics for 192.168.53.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 78ms, Maximum = 94ms, Average = 90ms
在主机
3
上的
ping
PC>ping 192.168.51.1
Pinging 192.168.51.1 with 32 bytes of data:
Reply from 192.168.51.1: bytes=32 time=125ms TTL=125
Reply from 192.168.51.1: bytes=32 time=125ms TTL=125
Reply from 192.168.51.1: bytes=32 time=125ms TTL=125
Reply from 192.168.51.1: bytes=32 time=125ms TTL=125
Ping statistics for 192.168.51.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 125ms, Maximum = 125ms, Average = 125ms
PC>ping 192.168.52.1
Pinging 192.168.52.1 with 32 bytes of data:
Reply from 192.168.52.1: bytes=32 time=63ms TTL=126
Reply from 192.168.52.1: bytes=32 time=78ms TTL=126
Reply from 192.168.52.1: bytes=32 time=93ms TTL=126
Reply from 192.168.52.1: bytes=32 time=94ms TTL=126
Ping statistics for 192.168.52.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 63ms, Maximum = 94ms, Average = 82ms