您好,欢迎访问三七文档
当前位置:首页 > 办公文档 > 其它办公文档 > 计算机网络路由器配置实验
实验四路由器配置实验(1)一、实验目的:熟悉华为路由模拟器的使用;熟悉路由器的基本配置及命令;通过实验验证路由相关知识,掌握路由器的配置方法;二、实验设备实验机房,计算机安装的是Windows2000或XP操作系统三、背景知识略四、实验内容和要求1.练习使用华为路由模拟器按要求创建网络,并进行简单配置;2.在路由器上配置端口及路由,实现不同网络主机的通信;五、实验步骤:5.1直连路由配置在华为路由模拟器中添加一个路由器和2个主机,连线如图一图一修改IP配置如下:PCA:192.168.1.2255.255.255.0PCB:192.168.2.2255.255.255.0(1)使用ping命令从HostApingHostB其他主机,观察ping命令返回结果:4packetstransmitted,0received,100%loss,time2000ms原因描述:子网掩码都为255.255.255.0,表示IP地址前三位为网络号,PCA和PCB的IP地址第三位都一致,即不在一个局域网内,所以执行ping命令后丢包率为100%。(2)设置路由器的端口E0:IP:192.168.1.1netmask:255.255.255.0E1:IP:192.168.2.1netmask:255.255.255.0配置命令:[Quidway]sysname123[123]interfaceethernet0[123-Ethernet0]ipaddr192.168.1.1255.255.255.0[123-Ethernet0]undoshutdown[123-Ethernet0]inte1[123-Ethernet1]ipaddr192.168.2.1255.255.255.0[123-Ethernet1]undoshutdown然后使用ping命令分别从HostA、HostBping其他主机,并观察分析返回结果:HostAping192.168.1.14packetstransmitted,4received,0%loss,time2000msHostBping192.168.2.14packetstransmitted,4received,0%loss,time2000ms原因描述:PCA和端口E0的ip地址在同一网络,所以执行ping命令后丢包率为100%;PCB和端口E1情况和上述一致。HostAping192.168.2.14packetstransmitted,0received,100%loss,time2000msHostBping192.168.1.14packetstransmitted,0received,100%loss,time2000ms原因描述:PCA和端口E1的ip地址不在同一网络,且PCA没有添加对应网关,所以执行ping命令后丢包率为100%;PCB和端口E0情况和上述一致。(思考:此时HostApingHostB是否能ping通?)此时HostApingHistB不能ping通(3)在HostA上添加网关192.168.1.1然后HostAping192.168.2.14packetstransmitted,4received,0%loss,time2000msHostAping192.168.2.24packetstransmitted,0received,100%loss,time2000ms原因描述:PCA和端口E1的ip地址不在同一网络,但PCA设置了对应网关,所以执行ping命令后丢包率为0%;由于PCB没有设置对应网关,回执信息没法反馈回来,所以从PCA向PCB执行ping命令后丢包率为100%。在HostB上添加网关192.168.2.1然后重做上述ping命令,观察结果。HostAping192.168.2.14packetstransmitted,4received,0%loss,time2000msHostAping192.168.2.24packetstransmitted,4received,0%loss,time2000ms原因描述:PCA和端口E1的ip地址不在同一网络,但PCA设置了对应网关,所以执行ping命令后丢包率为0%;而PCB也设置了对应网关,回执信息能够反馈回来,所以从PCA向PCB执行ping命令后丢包率为0%。5.2静态路由配置(1)修改网络连接如下图,同时配置HostAIP:192.168.1.2Netmask:255.255.255.0gw:192.168.1.1HostBIP:192.168.2.2Netmask:255.255.255.0gw:192.168.2.1HostCIP:192.168.3.2Netmask:255.255.255.0gw:192.168.3.1然后再按“5.1直连路由的配置”配置路由器routerB,使HostB和HostC能通信,并写出配置命令:[Quidway]sysname321[321]inte0[321-Ethernet0]ipaddrress192.168.2.1255.255.255.0[321-Ethernet0]undoshutdown[321-Ethernet0]inte1[321-Ethernet1]ipaddrress192.168.3.1255.255.255.0[321-Ethernet1]undoshutdown(2)配置routerA的E0端口IP192.168.1.1netmask255.255.255.0S0端口IP192.168.4.1netmask255.255.255.0配置命令:[123]inte0[123-Ethernet0]ipaddrress192.168.1.1255.255.255.0[123-Ethernet0]undoshutdown[123-Ethernet0]ints0[123-Serial0]ipaddrress192.168.4.1255.255.255.0配置routerBS0端口IP192.168.4.2netmask255.255.255.0配置命令:[321-Ethernet1]ints0[321-Serial0]ipaddrress192.168.4.2255.255.255.0然后,执行ping命令观察返回结果:HostAping192.168.4.14packetstransmitted,0received,100%loss,time2000msHostAping192.168.4.24packetstransmitted,0received,100%loss,time2000ms原因描述:在路由器A的S0端和PCA不在同一网络HostAping192.168.2.14packetstransmitted,0received,100%loss,time2000msHostAping192.168.3.14packetstransmitted,0received,100%loss,time2000ms原因描述:PCA与路由器A的S0端口不在同一网络(3)在routerA上配置静态路由,命令如下:iproute-static192.168.2.0255.255.255.0192.168.4.1然后,再执行ping命令;HostAping192.168.2.14packetstransmitted,4received,0%loss,time2000msHostAping192.168.2.24packetstransmitted,0received,100%loss,time2000msHostAping192.168.3.14packetstransmitted,0received,100%loss,time2000ms原因描述:在路由器A上没有到1952.168.3.0的路由,在路由器B上没有到192.168.1.0的路由,回执信息没有反馈回去在routerA上再增加一条到192.168.3.0的路由,命令如下:iproute-static192.168.3.0255.255.255.0192.168.4.1然后,再执行ping命令;HostAping192.168.3.14packetstransmitted,4received,0%loss,time2000msHostAping192.168.3.24packetstransmitted,0received,100%loss,time2000ms原因描述:在路由器B上没有到192.168.1.0的路由,回执信息没有反馈回去思考:分别从HostB和HostCpingHostA,是否能够ping通,为什么?试对routerB进行相关配置,使HostB、HostC能与HostA正常通信。不能ping通,因为路由器B上没有连接PCA的设置,在路由器B上增加一条道192.168.1.0的路由,命令如下:iproute-static192.168.1.0255.255.255.0192.168.4.2
本文标题:计算机网络路由器配置实验
链接地址:https://www.777doc.com/doc-5838447 .html