用 GNS3 做CCNA网络实验(4)
7. 路由实验: 静态路由 Static Routing
(1) 准备实验
我们假定是关闭 GNS3 后重新打开 GNS3 开始新的实验。
先为这次实验准备一个子目录,例如 在 gns3Project 下建一个子目录 stat1.
在 GNS3 打开我们以前保存的已经测试过的 topology, 例如 router1.net 然后装入配置文件。
在 GNS3 菜单 File -> Save topology as 把这个 topology 改名为 statr1.net 并保存 到 stat1 子目录下。
在 菜单 File -> Import/Export 选 Export to a directory 把原来的配置卸出到子目录 stat1 下。
这样,下面的实验所用到的 topology 和更改配置后的保存都放在这个子目录下。
(2) 查看当前路由信息
启动各个路由器 (R1, R2 和 PC1, PC2).
R1 的输出:
R2 的输出:
(3) 配置路由器
按照这个 topology, 路由器 R1 直接连接 2 个网段, 网络地址分别为: 192.168.100.0 和 172.17.1.0
而数据包要发送到 网段 192.168.110.0, 则需要经过 R2 的端口 s2/1 进入,这个端口的地址是 172.17.1.2
我们就在 R1 输入:
同样, 路由器 R2 直接连接 2 个网段, 网络地址分别为: 192.168.110.0 和 172.17.1.0
数据包要发送到 192.168.100.0 网段,是要经过 R1 的端口 s2/0 进入, 这个 s2/0 的地址是 172.17.1.1
我们在 R2 输入:
(3) 测试
从 R1 ping R2 和 PC2
R1#ping 172.17.1.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.17.1.2, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 192/315/440 ms R1#ping 192.168.110.253 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.110.253, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 244/288/316 ms R1#ping 192.168.110.22 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.110.22, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 392/616/752 ms R1#
从 R2 ping R1 和 PC1
R2#ping 172.17.1.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.17.1.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 248/295/332 ms R2#ping 192.168.100.254 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.100.254, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 228/292/368 ms R2#ping 192.168.100.10 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.100.10, timeout is 2 seconds: !!! R2#
从 PC1 ping R2 和 PC2
PC1#ping 192.168.100.254 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.100.254, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 356/636/1456 ms PC1#ping 172.17.1.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.17.1.2, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 644/741/948 ms PC1#ping 192.168.110.253 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.110.253, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 616/692/812 ms PC1#ping 192.168.110.22 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.110.22, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1120/1224/1368 ms PC1#
从 PC2 ping R1 和 PC1
PC2#ping 192.168.100.254 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.100.254, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 728/791/812 ms PC2#ping 192.168.100.10 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.100.10, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1064/1176/1288 ms PC2#
现在这个网络 3 个网段已经连通。
(4) 启用路由协议后的路由信息
R1:
R2:
下一步我们尝试动态路由协议的配置。
:-