实验目标:搭建企业中的VPN服务器 实验环境:两台思科模拟路由器、和一台红帽子Linux 、xp 实验拓扑:

实验要求:要求在异地的VPN用户通过公司内部的VPN服务器去安全的访问局域网内的一 台web服务器 实验分析:公司局域网内的web服务器是没有设置网关的、所以只对局域网内的用户访问,而在异地的用户想访问局域网的web服务器,这就需要在企业边缘的路由器上配置VPN了,在这里边缘路由器为R7,所以在R7上配置VPN VPN是建立在网络互通的环境下配置的 第一步:通过基本的配置使192.168.15.2可以正常的和R7 fa2/0接口正常通信,在路由器上使用的协议为rip2 以下为分别在R6\R7配置网络连通的基本步骤 R6: RZ6#enable RZ6#conf t Enter configuration commands, one per line. End with CNTL/Z. RZ6(config)#no ip domain-lookup RZ6(config)#ip classless RZ6(config)#ip subnet-zero RZ6(config)#hostname RZ6 RZ6(config)#int fa2/0 RZ6(config-if)#ip address 192.168.15.2 255.255.255.0 RZ6(config-if)#no shut RZ6(config-if)#int s1/2 RZ6(config-if)#ip address 192.168.16.1 255.255.255.0 RZ6(config-if)#no shut RZ6(config-if)#exit RZ6(config)#router rip RZ6(config-router)#version 2 RZ6(config-router)#net 192.168.15.0 RZ6(config-router)#net 192.168.16.0 RZ6(config-router)#end RZ6# Jul 25 18:12:50.291: %SYS-5-CONFIG_I: Configured from console by console Jul 25 18:12:50.791: %SYS-5-CONFIG_I: Configured from console by console R7: Router> Router>enable Router#conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#no ip domain-lookup Router(config)#ip classless Router(config)#ip subnet-zero Router(config)#hostname RZ7-VPNSRV RZ7-VPNSRV(config)#int fa2/0 RZ7-VPNSRV(config-if)#ip address 192.168.17.1 255.255.255.0 RZ7-VPNSRV(config-if)#no shut RZ7-VPNSRV(config-if)#int s1/5 RZ7-VPNSRV(config-if)#ip address 192.168.16.2 255.255.255.0 RZ7-VPNSRV(config-if)#no shut RZ7-VPNSRV(config-if)#exit RZ7-VPNSRV(config)#router rip RZ7-VPNSRV(config-router)#version 2 RZ7-VPNSRV(config-router)#net 192.168.17.0 RZ7-VPNSRV(config-router)#net 192.168.16.0 RZ7-VPNSRV(config-router)#end RZ7-VPNSRV# Jul 25 18:15:30.331: %SYS-5-CONFIG_I: Configured from console by console Jul 25 18:15:32.119: %LINK-3-UPDOWN: Interface FastEthernet2/0, changed state to up Jul 25 18:15:32.119: %ENTITY_ALARM-6-INFO: CLEAR INFO Fa2/0 Physical Port Administrative State Down Jul 25 18:15:32.179: %LINK-3-UPDOWN: Interface Serial1/5, changed state to up Jul 25 18:15:32.179: %ENTITY_ALARM-6-INFO: CLEAR INFO Se1/5 Physical Port Administrative State Down Jul 25 18:15:33.119: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet2/0, changed state to up Jul 25 18:15:33.179: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/5, changed state to up 在R6上查看的路由表 RZ6#show ip route Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route Gateway of last resort is not set C 192.168.15.0/24 is directly connected, FastEthernet2/0 R 192.168.17.0/24 [120/1] via 192.168.16.2, 00:00:02, Serial1/2 C 192.168.16.0/24 is directly connected, Serial1/2 RZ6# 现在网络已经保证基本的畅通了 然后下来关键的一步、在R7上做VPN 下面是配置R7为VPN得主要内容 RZ7-VPNSRV#conf t Enter configuration commands, one per line. End with CNTL/Z. RZ7-VPNSRV(config)#username haha password 0 haha123 //创建账户haha密码为haha123 RZ7-VPNSRV(config)#vpdn enable //开启二层(数据链路层)VPN RZ7-VPNSRV(config)#vpdn-group myl2tp //为了好管理建立VPN分组,名为mayl2tp RZ7-VPNSRV(config-vpdn)#accept-dialin //允许用户拨入 RZ7-VPNSRV(config-vpdn-acc-in)#protocol l2tp //使用的协议为l2tp RZ7-VPNSRV(config-vpdn-acc-in)#virtual-template 1 //用虚拟模板1自动生成逻辑接口 RZ7-VPNSRV(config-vpdn-acc-in)#exit RZ7-VPNSRV(config-vpdn)#no l2tp tunnel authentication //隧道上不做身份认证 RZ7-VPNSRV(config-vpdn)#exit RZ7-VPNSRV(config)#interface Virtual-Template1 //进入接口Virtual-Templatel RZ7-VPNSRV(config-if)#ip unnumbered s1/5 //使用s1/5接口的ip作为Virtual-Templatel的ip RZ7-VPNSRV(config-if)#encapsulation ppp //封装ppp协议 RZ7-VPNSRV(config-if)#peer default ip address pool l2tp-user //创建地址池,名字为L2tp RZ7-VPNSRV(config-if)#ppp authentication chap //ppp验证方式为chap RZ7-VPNSRV(config-if)#exit RZ7-VPNSRV(config)#ip local pool l2tp-user 192.168.17.5 192.168.17.15 //地址池为192.168.17.5到192.168.17.15 RZ7-VPNSRV(config)#end RZ7-VPNSRV# Jul 25 18:15:59.935: %SYS-5-CONFIG_I: Configured from console by console 路由器上的配置已完成、最后还需要客户端修改注册表 1、在VPN客户端的计算机中,单击开始、运行、输入regedit、确定 2、找到下面的注册表子项然后单击它 HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Rasman\Parameters 3、在该项中新建一个“DWORD值”将该项名称修改为“ProhibitIpSec”并修改数值数据为1

然后退出,重新启动计算机 重启后在计算机中建立拨号连接