1、1计算机网络实验 (4B)实验名称:路由器的基本操作及静态路由配置实验实验目的:了解路由器的基本结构,功能,应用环境以及基本参数的配置。实验要求:1配置路由器接口的 IP 地址。2设置静态路由。3. 测试静态路由: ping IP 地址 ; trace IP 地址4写出实验报告实验准备知识:一、实验环境的搭建: 准备 PC 机 2 台,操作系统为 Windows XP ; 准备 Huawei S2501E 路由器 3 台 ; 路由器串口线(2 对) 交叉线(或通过交换机的直连线) 网线 2 条; Console 电缆 2 条。2二、实验操作步骤步骤: del 删除各个路由器原有的路由表 第一步
2、:设置 Router1 QuidwaySYSNAME R1#进入以太网接口视图: R1 interface Ethernet 0 #设置其 IP 地址 R1-Ethernet0 ip address 10.0.0.2 255.255.255.0shutdownundo shutdown #激活此以太网口!(对此口配置了 IP 地址后用此命令)#进入串口 Serial0 视图 R1-Ethernet0 interface serial 0 #设置其 IP 地址 R1-Serial0 ip address 20.1.0.1 255.255.255.0 shutdownundo shutdown #
3、激活此串口!(对此口配置了 IP 地址后用此命令)#设置链路层协议为 PPP R1-Serial0 link-protocol ppp#进入系统视图 R1-Serial0 quit#添加静态路由 R1 ip route-static 40.1.0.0 255.255.255.0 20.1.0.2 preference 60#添加静态路由(R2 的以太网接口)R1 ip route-static 50.1.0.0 255.255.255.0 20.1.0.2 preference 60#保存路由器设置 R1 save #重启路由器 R1 reboot3 第二步:设置 Router2 Quidwa
4、ySYSNAME R2#进入以太网接口视图: R2 interface Ethernet 0 #设置其 IP 地址 R2-Ethernet0 ip address 50.1.0.2 255.255.255.0shutdownundo shutdown #激活此以太网口!#进入串口 Serial0 视图 R2-Ethernet0 interface serial 0 #设置其 IP 地址 R2-Serial0 ip address 20.1.0.2 255.255.255.0 shutdownundo shutdown #激活此串口!(对此口配置了 IP 地址后用此命令)#设置链路层协议为 PP
5、P R2-Serial0 link-protocol ppp#进入系统视图 R2-Serial0 quit#进入串口 Serial1 视图 R2 interface serial 1#设置其 IP 地址 R2-Serial1 ip address 30.1.0.1 255.255.255.0 shutdownundo shutdown #激活此串口!(对此口配置了 IP 地址后用此命令)#设置链路层协议为 PPP R2-Serial1 link-protocol ppp#进入系统视图 R2-Serial1 quit4#添加静态路由 R2 ip route-static 40.1.0.0 255
6、.255.255.0 30.1.0.2 preference 60 R2 ip route-static 10.0.0.0 255.255.255.0 20.1.0.1 preference 60#保存路由器设置 R2 save #重启路由器 R2 reboot 第三步:设置 Router3 QuidwaySYSNAME R3#进入以太网接口视图: R3 interface Ethernet 0 #设置其 IP 地址 R3-Ethernet0 ip address 40.1.0.1 255.255.255.0shutdownundo shutdown #激活此以太网口!#进入串口 Serial
7、1 视图 R3-Ethernet0 interface serial 1 #设置其 IP 地址 R3-Serial1 ip address 30.1.0.2 255.255.255.0 shutdownundo shutdown #激活此串口!(对此口配置了 IP 地址后用此命令)#设置链路层协议为 PPP R3-Serial1 link-protocol ppp#进入系统视图 R3-Serial1 quit5#添加静态路由 R3 ip route-static 50.1.0.0 255.255.255.0 30.1.0.1 preference 60 R3 ip route-static 1
8、0.0.0.0 255.255.255.0 30.1.0.1 preference 60#保存路由器设置 R3 save #重启路由器 R3 reboot 第四步:设置主机 TCP/IP 属性: PC1:IP 地址:10.0.0.1 子网掩码:255.255.255.0默认网关:10.0.0.2 PC2:IP 地址:40.1.0.2 子网掩码:255.255.255.0默认网关:40.1.0.1 第四步:用 Ping 命令测试结论:整个网络是连通的62 个路由器的静态路由表查看路由! R1R1display ip routing-tableRouting Tables:Destination/
9、Mask Proto Pref Metric Nexthop Interface10.1.1.0/24 Direct 0 0 10.1.1.1 Ethernet010.1.1.1/32 Direct 0 0 127.0.0.1 LoopBack020.1.1.0/24 Direct 0 0 20.1.1.1 Serial120.1.1.1/32 Direct 0 0 20.1.1.1 Serial120.1.1.2/32 Direct 0 0 127.0.0.1 LoopBack030.1.1.0/24 Static 60 0 20.1.1.1 Serial1127.0.0.0/8 Direc
10、t 0 0 127.0.0.1 LoopBack0127.0.0.1/32 Direct 0 0 127.0.0.1 LoopBack0R2display ip routing-tableRouting Tables:Destination/Mask Proto Pref Metric Nexthop Interface10.1.1.0/24 Static 60 0 20.1.1.2 Serial120.1.1.0/24 Direct 0 0 20.1.1.2 Serial120.1.1.1/32 Direct 0 0 127.0.0.1 LoopBack020.1.1.2/32 Direct 0 0 20.1.1.2 Serial130.1.1.0/24 Direct 0 0 30.1.1.1 Ethernet030.1.1.1/32 Direct 0 0 127.0.0.1 LoopBack0127.0.0.0/8 Direct 0 0 127.0.0.1 LoopBack0127.0.0.1/32 Direct 0 0 127.0.0.1 LoopBack0