本实验的拓扑结构如下图所示。
3台路由器分别命名为R1、R2和R3,所使用的接口和相应的IP地址分配如上图中的标注。图中的"/24"表示子网掩码为24位,即255.255.255.0。 实验中,应使用静态路由的设置。实现R2到R3在IP层的连通性,即要求从R2可以ping通R3,反之亦然。END
3台Cisco 808路由器,具有2个以太网接口
2台Hub,4条双绞线 (也可以用2条交叉网线直接把3台路由器连接起来)
1台带有超级终端程序的PC机,以及Console电缆及转接器。
根据拓扑结构图的要求,正确配置各路由器的以太网接口。路由器R1的接口配置如下: R1>enable R1#config terminal R1(config)#interface ethernet 0/0 R1(config-if)#ip address 10.1.1.1 255.255.255.0 R1(config-if)#no shutdown R1(config-if)#exit R1(config)#interface ethernet 0/1 R1(config-if)#ip address 172.16.1.1 255.255.255.0 R1(config-if)#no shutdown R1(config-if)#end路由器R2的接口配置如下: R2>enable R2#config terminal R2(config)#interface ethernet 0/0 R2(config-if)#ip address 10.1.1.2 255.255.255.0 R2(config-if)#no shutdown R2(config-if)#end路由器R3的接口配置如下: R3>enable R3#config terminal R3(config)#interface ethernet 0/0 R3(config-if)#ip address 172.16.1.3 255.255.255.0 R3(config-if)#no shutdown R3(config-if)#end
测试自身连通性R1#ping 10.1.1.1Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.1.1.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 msR1#ping 172.16.1.1Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.1.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 msR2#ping 10.1.1.2Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.1.1.2, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 msR3#ping 172.16.1.3Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.1.3, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms
设置路由前测试网络连通性R2#ping 172.16.1.3Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.1.3, timeout is 2 seconds: !!!!! Success rate is 0 percent (0/5)R3#ping 10.1.1.2Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.1.1.2, timeout is 2 seconds: !!!!! Success rate is 0 percent (0/5)
检查路由表R1#show ip route Gateway of last resort is not setrout C 10.1.1.0/24 is directly connected, 10.1.1.1 C 172.16.1.0/24 is directly connected, 172.16.1.1R2#show ip route Gateway of last resort is not set C 10.1.1.0/24 is directly connected, 10.1.1.2R3#show ip route Gateway of last resort is not set C 172.16.1.0/24 is directly connected, 172.16.1.3
加入静态路由并测试连通性R2#config terminalR2(config)#ip route 172.16.1.0 255.255.255.0 10.1.1.1R2(config)#endR2#show ip route C10.1.1.0/24 is directly connected, 10.1.1.2 S 172.16.1.0/24 [1/0] via 10.1.1.1R2#ping 172.16.1.1Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.1.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 msR2#ping 172.16.1.3Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.1.3, timeout is 2 seconds: !!!!! Success rate is 0 percent (0/5)R3#config terminalR3(config)#ip route 10.1.1.0 255.255.255.0 172.16.1.1R3(config)#endR3#show ip route C172.16.1.0/24 is directly connected, 172.16.1.3 S 10.1.1.0/24 [1/0] via 172.16.1.1R3#ping 10.1.1.1
Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.1.1.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms
R3#ping 10.1.1.2
Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.1.1.2, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms
R1#show ip route
C 10.1.1.0/24 is directly connected, 10.1.1.1 C 172.16.1.0/24 is directly connected, 172.16.1.1
不具备实训条件可以使用RouterSim软件模拟