您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 质量控制/管理 > 57【网络安全】【使用路由器构建GRE VPN】
使用路由器构建GREVPN【实验名称】使用路由器构建GREVPN【实验目的】学习配置站点到站点(Site-to-Site)的GREVPN隧道,加深对GRE协议的理解。【背景描述】假设北京的某公司在上海设立了新的分公司,分公司要能够访问总公司的各种网络资源,例如:CRM系统、FTP服务器等,并且要求分公司和总公司之间共享路由信息。这家公司希望通过VPN技术实现两个站点的数据传输。【需求分析】需求:解决上海分公司和北京总公司之间通过Internet进行路由信息和数据信息传输的问题。分析:GREVPN技术通过隧道技术有效的保证了数据在Internet网络的传输,并且GRE支持对组播和广播数据的封装,可用于封装路由协议报文。【实验拓扑】【实验设备】路由器3台PC2台【预备知识】网络基础知识路由协议基础知识VPN基础知识GRE工作原理【实验原理】2GRE(GenericRoutingEncapsulation,通用路由封装)协议是一个隧道协议,使用IP协议号47。GRE通常用来构建站点到站点的VPN隧道,它最大的优点是可以对多种协议、多种类型的报文进行封装,并在隧道中传输。但是GRE不提供对数据的保护(例如加密),它只提供简单的隧道验证功能。【实验步骤】第一步:配置Internet路由器R3R3#configureterminalR3(config)#interfacefastEthernet1/0R3(config-if)#ipaddress1.1.1.2255.255.255.252R3(config-if)#exitR3(config)#interfacefastEthernet1/1R3(config-if)#ipaddress2.2.2.2255.255.255.252R3(config-if)#exit第二步:配置R1与R2的Internet连通性R1#configureterminalR1(config)#interfacefastEthernet1/0R1(config-if)#ipaddress1.1.1.1255.255.255.252R1(config-if)#exitR1(config)#interfacefastEthernet1/1R1(config-if)#ipaddress192.168.1.1255.255.255.0R1(config-if)#exitR1(config)#iproute0.0.0.00.0.0.01.1.1.2R2#configureterminalR2(config)#interfacefastEthernetf1/1R2(config-if)#ipaddress2.2.2.1255.255.255.252R2(config-if)#exitR2(config)#interfacefastEthernet1/0R2(config-if)#ipaddress192.168.2.1255.255.255.0R2(config-if)#exitR2(config)#iproute0.0.0.00.0.0.02.2.2.2第三步:配置R1的GRE隧道R1(config)#interfacetunnel1R1(config-if)#ipaddress10.1.1.1255.255.255.0R1(config-if)#tunnelsourcefastEthernet1/0!配置隧道的源接口或源地址R1(config-if)#tunneldestination2.2.2.1!配置隧道的目的地址R1(config-if)#tunnelkey1234567!配置隧道验证密钥R1(config-if)#exit第四步:在R1上启用RIPv2路由协议R1(config)#routerrip3R1(config-router)#version2R1(config-router)#noauto-summaryR1(config-router)#network10.0.0.0!在GRE隧道接口启用RIPv2R1(config-router)#network192.168.1.0!在内部接口启用RIPv2R1(config-router)#exit第五步:配置R2的GRE隧道R2(config)#interfacetunnel1R2(config-if)#ipaddress10.1.1.2255.255.255.0R2(config-if)#tunnelsourcefastEthernet1/1!配置隧道的源接口或源地址R2(config-if)#tunneldestination1.1.1.1!配置隧道的目的地址R2(config-if)#tunnelkey1234567!配置隧道验证密钥R2(config-if)#exit第六步:在R2上启用RIPv2路由协议R2(config)#routerripR2(config-router)#version2R2(config-router)#noauto-summaryR2(config-router)#network10.0.0.0!在GRE隧道接口启用RIPv2R2(config-router)#network192.168.2.0!在内部接口启用RIPv2R2(config-router)#exit第七步:配置PC1和PC2PC1的IP地址为192.168.1.2,网关为192.168.1.1PC2的IP地址为192.168.2.2,网关为192.168.2.1第八步:验证测试在R1与R2上验证GRE隧道状态及路由表信息,分别通过tunnel接口学习到对端局域网的路由。R1#showinterfacetunnel1Tunnel1isUP,lineprotocolisUP!隧道状态为UPHardwareisTunnelInterfaceaddressis:10.1.1.1/24MTU1472bytes,BW9KbitEncapsulationprotocolisTunnel,loopbacknotsetKeepaliveintervalis0sec,nosetCarrierdelayis0secRXloadis1,Txloadis1Tunnelsource1.1.1.1(FastEthernet1/0),destination2.2.2.1Tunnelprotocol/transportGRE/IP,key0x12d687,sequencingdisabledChecksummingofpacketsdisabledQueueingstrategy:WFQ5minutesinputrate0bits/sec,0packets/sec5minutesoutputrate12bits/sec,0packets/sec0packetsinput,0bytes,0nobuffer4Received0broadcasts,0runts,0giants0inputerrors,0CRC,0frame,0overrun,0abort19packetsoutput,988bytes,0underruns0outputerrors,0collisions,0interfaceresetsR1#showiprouteCodes:C-connected,S-static,R-RIPO-OSPF,IA-OSPFinterareaN1-OSPFNSSAexternaltype1,N2-OSPFNSSAexternaltype2E1-OSPFexternaltype1,E2-OSPFexternaltype2*-candidatedefaultGatewayoflastresortis1.1.1.2tonetwork0.0.0.0S*0.0.0.0/0[1/0]via1.1.1.2C1.1.1.0/30isdirectlyconnected,FastEthernet1/0C1.1.1.1/32islocalhost.C10.1.1.0/24isdirectlyconnected,Tunnel1C10.1.1.1/32islocalhost.C192.168.1.0/24isdirectlyconnected,FastEthernet1/1C192.168.1.1/32islocalhost.R192.168.2.0/24[120/1]via10.1.1.2,00:00:29,Tunnel1R2#showinterfacetunnel1Tunnel1isUP,lineprotocolisUP!隧道状态为UPHardwareisTunnelInterfaceaddressis:10.1.1.2/24MTU1472bytes,BW9KbitEncapsulationprotocolisTunnel,loopbacknotsetKeepaliveintervalis0sec,nosetCarrierdelayis0secRXloadis1,Txloadis1Tunnelsource2.2.2.1(FastEthernet1/1),destination1.1.1.1Tunnelprotocol/transportGRE/IP,key0x12d687,sequencingdisabledChecksummingofpacketsdisabledQueueingstrategy:WFQ5minutesinputrate31bits/sec,0packets/sec5minutesoutputrate36bits/sec,0packets/sec55packetsinput,3700bytes,0nobufferReceived0broadcasts,0runts,0giants0inputerrors,0CRC,0frame,0overrun,0abort58packetsoutput,4080bytes,0underruns0outputerrors,0collisions,0interfaceresetsR2#showiproute5Codes:C-connected,S-static,R-RIPO-OSPF,IA-OSPFinterareaN1-OSPFNSSAexternaltype1,N2-OSPFNSSAexternaltype2E1-OSPFexternaltype1,E2-OSPFexternaltype2*-candidatedefaultGatewayoflastresortis2.2.2.2tonetwork0.0.0.0S*0.0.0.0/0[1/0]via2.2.2.2C2.2.2.0/30isdirectlyconnected,FastEthernet1/1C2.2.2.1/32islocalhost.C10.1.1.0/24isdirectlyconnected,Tunnel1C10.1.1.2/32islocalhost.R192.168.1.0/24[120/1]via10.1.1.1,00:00:20,Tunnel1C192.168.2.0/24isdirectlyconnected,FastEthernet1/0C192.168.2.1/32islocalhost.第九步:验证测试在PC1上pingPC2,可以ping通。【注意事项】zGRE隧道两端的密钥要匹配。z隧道两端的源和目的相互对应,即R1的源地址为R2的目的地址,R2的源地址为R1的目的地址。z需要在Tunnel接口启用路由,而非连接Internet的接口。【参考配置】R1#showrunning-configBuildingconfiguration...Currentconfiguration:764bytes6!hostnameR1!noservicepassword-encryption!interfaceserial1/2clockrate64000!interfaces
本文标题:57【网络安全】【使用路由器构建GRE VPN】
链接地址:https://www.777doc.com/doc-1248074 .html