实验四动态路由协议实验4.1RIPV1基本配置【实验名称】RIPV1基本配置【实验目的】掌握在路由器上配置RIPV1。【背景描述】假设校园网通过一台路由器连接到校园外的另一台路由器上,现要在路由器上做适当配置,实现校园网内部主机与校园网外部主机的相互通信。本实验以2台R2624路由器为例,路由器分别命名为Router1和Router2,路由器之间通过串口采用V35DCE/DTE电缆连接,DCE端连接到Router1(R2624)上。PC1的IP地址和缺省网关分别为172.16.1.11和172.16.1.1,PC2的IP地址和缺省网关分别为172.16.3.22和172.16.3.2,网络掩码都是255.255.255.0。【实现功能】实现网络的互连互通,从而实现信息的共享和传递。【实验拓扑】172.16.1.0/24172.16.2.0/24172.16.3.0/24Router1Router2PC111112222PC2【实验设备】R2624路由器(2台)、V35DCE(1根)、V35DTE(1根)【实验步骤】第一步:在路由器Router1上配置接口的IP地址和串口上的时钟频率Router1(config)#interfacefastethernet0!进入接口F0的配置模式Router1(config-if)#ipaddress172.16.1.1255.255.255.0!配置路由器接口F0的IP地址Router1(config-if)#noshutdown!开启路由器fastethernet0接口!Router1(config)#interfaceserial0!进入接口S0配置模式Router1(config-if)#ipaddress172.16.2.1255.255.255.0!配置路由器接口S0的IP地址Router1(config-if)#clockrate64000!配置Router1的时钟频率(DCE)Router1(config-if)#noshutdown!开启路由器serial0接口验证测试:验证路由器接口的配置和状态Router1#showipinterfacebriefInterfaceIP-AddressOK?MethodStatusProtocolFastEthernet0172.16.1.1YESmanualupupFastEthernet1unassignedYESunsetadministrativelydowndownFastEthernet2unassignedYESunsetadministrativelydowndownFastEthernet3unassignedYESunsetadministrativelydowndownSerial0172.16.2.1YESmanualdowndownSerial1unassignedYESunsetadministrativelydowndown注:串口Serial0的链路层状态是down,这是因为对端接口还没有配置。第二步:在路由器Router1上配置RIPV1路由协议Router1(config)#routerrip!创建RIP路由进程Router1(config-router)#network172.16.0.0!定义关联网络(必须是直连的主类网络地址)验证测试:验证Router1上的RIPV1路由表Router1#showiprouteCodes:C-connected,S-static,R-RIPO-OSPF,IA-OSPFinterareaE1-OSPFexternaltype1,E2-OSPFexternaltype2Gatewayoflastresortisnotset172.16.0.0/24issubnetted,2subnetsC172.16.1.0isdirectlyconnected,FastEthernet0C172.16.2.0isdirectlyconnected,Serial0第三步:在路由器Router2上配置接口的IP地址Router2(config)#interfacefastethernet0!进入接口F0的配置模式Router2(config-if)#ipaddress172.16.3.2255.255.255.0!配置路由器接口F0的IP地址Router2(config-if)#noshutdown!开启路由器fastethernet0接口!Router2(config)#interfaceserial0!进入接口S0配置模式Router2(config-if)#ipaddress172.16.2.2255.255.255.0!配置路由器接口S0的IP地址Router2(config-if)#noshutdown!开启路由器serial0接口验证测试:验证路由器接口的配置和状态Router2#showipinterfacebriefInterfaceIP-AddressOK?MethodStatusProtocolFastEthernet0172.16.3.2YESmanualupupFastEthernet1unassignedYESunsetadministrativelydowndownFastEthernet2unassignedYESunsetadministrativelydowndownFastEthernet3unassignedYESunsetadministrativelydowndownSerial0172.16.2.2YESmanualupupSerial1unassignedYESunsetadministrativelydowndown第四步:在路由器Router2上配置RIPV1路由协议Router2(config)#routerrip!创建RIP路由进程Router2(config-router)#network172.16.0.0!定义关联网络(必须是直连的主类网络地址)验证测试:验证Router2和Router1上的RIPV1路由表Router2#showiprouteCodes:C-connected,S-static,R-RIPD-EIGRP,EX-EIGRPexternal,O-OSPF,IA-OSPFinterareaE1-OSPFexternaltype1,E2-OSPFexternaltype2Gatewayoflastresortisnotset172.16.0.0/24issubnetted,3subnetsR172.16.1.0[120/1]via172.16.2.1,00:00:16,Serial0!Router2通过RIP协议获得的路由C172.16.2.0isdirectlyconnected,Serial0C172.16.3.0isdirectlyconnected,FastEthernet0Router1#shiprouteCodes:C-connected,S-static,R-RIPO-OSPF,IA-OSPFinterareaE1-OSPFexternaltype1,E2-OSPFexternaltype2Gatewayoflastresortisnotset172.16.0.0/24issubnetted,3subnetsC172.16.1.0isdirectlyconnected,FastEthernet0C172.16.2.0isdirectlyconnected,Serial0R172.16.3.0[120/1]via172.16.2.2,00:00:08,Serial0!Router1通过RIP协议获得的路由第五步:测试网络的连通性。C:\ping172.16.3.22!从PC1pingPC2C:\ping172.16.1.11!从PC2pingPC1【注意事项】1在串口上配置时钟频率时,一定要在电缆DCE端的路由器上配置,否则链路不通;2定义关联网络时,命令network后面必须是与该路由器直连的主类网络地址。【参考配置】Router1#showrunning-config!显示路由器Router1的全部配置Buildingconfiguration...Currentconfiguration:!version6.14(2)!hostnameRouter1!enablesecret5$1$CT43$gMntVy1ViUeKqRfmWanw/0!ipsubnet-zero!!endRouter2#showrunning-config!显示路由器Router2的全部配置Buildingconfiguration...Currentconfiguration:!hostnameRed-Giant!enablesecret5$1$TK6E$V8xIZJ40aN1LYoUd27U45/!ipsubnet-zero!interfaceFastEthernet0ipaddress172.16.3.2255.255.255.0!interfaceFastEthernet1noipaddressshutdown!interfaceFastEthernet2noipaddressshutdown!interfaceFastEthernet3noipaddressshutdown!interfaceSerial0ipaddress172.16.2.2255.255.255.0!interfaceSerial1noipaddressshutdown!routerripnetwork172.16.0.0!ipclassless!linecon0lineaux0linevty04passwordstarlogin!end实验4.2在不连续的子网中运行RIPV1【实验名称】在不连续的子网中运行RIPV1【实验目的】掌握在不连续的子网中配置RIPV1。【背景描述】假设校园网通过一台路由器连接到校园外的另一台路由器上,中间穿过的是另一个主网络192.168.1.0/24,而校园内网和外部网则是主网络172.16.0.0/16的两个子网,现要在路由器上做适当配置,实现校园网内部主机与校园网外部主机的相互通信。本实验以2台R2624路由器为例,路由器分别为Router1和Router2,路由器之间通过串口采用V35DCE/DTE电缆连接,DCE端连接到Router1上。PC1的IP地址和缺省网关分别为172.16.1.11和172.16.1.1,PC2的IP地址和缺省网关分别为172.16.3.22和172.16.3.2,网络掩码都是255.255.255.0。【实现功能】实现不连续子网的互连互通,从而实现信息的共享和传递。【实验拓扑】172.16.1.0/24192.168.1.0/24172.16.3.0/24Router1Router2PC111112222PC2【实验设备】R2624路由器(2台)、V35DCE(1根)、V35DTE(1根)【实验步骤】第一步:在路由器Router1上配置接口的IP地址和串口上的时钟频率Router1(config)#interfacefastethernet0!进入接口F0的配置模式Router1(config-if)#ipaddress172.16.1.1255.255.255.0!配置路由器接口F0的IP地址Router1(config-if)#noshutdown!开启路由器fastethernet0接口!Router1(config)#interfaceserial0!进入接口S0配置模式Router1(config-if)#ipaddress192.168.1.1255.255.255.0!配置路由器接口S0的IP地址Router1(config-if)#clockrate64000!配置Router1的时钟频率(DCE)Router1(config-if)#nosh