VPN英文全称是“Virtual Private Network”,就是“虚拟专用网络”。可以远程帮助用户、分公司、商业伙伴及供应商同公司的内部网建立可信的安全连接,用于经济有效地连接到商业伙伴和用户的安全外联网虚拟专用网。
搭建环境:
服务器系统:Windows server 2008 R2
客户机系统:Windows 7
具体配置如下:
一、配置环境
1、点击“开始”右边的“服务器管理器”
![](https://img-blog.csdnimg.cn/img_convert/5d17e69ed29251bc2376ab90e8192378.png)
2、在“服务器管理器”里点击“角色”,右击选译“添加角色”,点击“下一步”
![](https://img-blog.csdnimg.cn/img_convert/e02f155505b6b72d10ba9945c4e71b9c.png)
3、在“角色”里选择“网络策略和访问服务”,点击“下一步”
![](https://img-blog.csdnimg.cn/img_convert/de53494e3b11bfb45c8f4b9bc63d21d1.png)
4、点击“下一步”
![](https://img-blog.csdnimg.cn/img_convert/972e6d53f78ecbcac8d88f3b57f45335.png)
5、选择“路由和远程访问服务”,点击“安装”
![](https://img-blog.csdnimg.cn/img_convert/1e7c2db469aefa1e468e8c0b222f29ce.png)
![](https://img-blog.csdnimg.cn/img_convert/bb0403f979f687df56591002c8f9f8c8.png)
二、配置VPN服务器
1、点击“角色”-“网络策略和访问服务”-“路由和远程访问”
![](https://img-blog.csdnimg.cn/img_convert/d2ab7a5df3bef8aaf111f75f07a55688.png)
2、在“路由和远程访问”上点右键选择“配置并启用路由和远程访问”,点击“下一步”
![](https://img-blog.csdnimg.cn/img_convert/39f9490f2072742682c58688e5582fbe.png)
![](https://img-blog.csdnimg.cn/img_convert/aa6180971050bde26f427bee7c042255.png)
3、选译“自定义配置”点击“下一步”
![](https://img-blog.csdnimg.cn/img_convert/0e3ba7121ab39ff1021fbf7319edd463.png)
4、选择“VPN访问”和“NAT”点击“下一步”
![](https://img-blog.csdnimg.cn/img_convert/2d6acae0b209716ccc653a565292fae4.png)
5、配置成功点击“完成”,出现提示”启动服务”点击“启动服务”。
![](https://img-blog.csdnimg.cn/img_convert/1413bdc2e9c46575b0f3555f4310795b.png)
三、配置NAT:
1、在“路由和远程访问”-“IPv4”-“NAT”上点击右键选择“新增接口”
![](https://img-blog.csdnimg.cn/img_convert/3d4710c89e58693847caa900fbd5e1ad.png)
2、在接口里选一下你的外网接口,我这里的是外部连接,点击“确定”弹出属性。
![](https://img-blog.csdnimg.cn/img_convert/7e8b32617e31bb62901bfa6904ef648d.png)
3、在这里选择“公用接口连接到Internet”-“在此接口上启用NAT”,点击确定。
![](https://img-blog.csdnimg.cn/img_convert/7e5e97d1f154ab3914c27e2fca146372.png)
4、在“路由和远程访问”上点击右键选择“属性”
![](https://img-blog.csdnimg.cn/img_convert/c99599b96ea12f2d43244771628d8049.png)
5、在弹出的窗口中选译“IPv4”-“静态地址池”点击“添加”,在“起始IP地址”里输入“192.168.0.160”,“结束IP地址”里输入“192.168.0.254”点击“确定”
![](https://img-blog.csdnimg.cn/img_convert/526f588c17a5e174404b52ea0b9ddb95.png)
6、右击NAT-新增接口-内部-专用接口 (连接虚拟专用网络)
![](https://img-blog.csdnimg.cn/img_convert/b98c4a06bdb86800f89c9e91d145a8e8.png)
![](https://img-blog.csdnimg.cn/img_convert/af677f68d79cb401f752229ccbce6612.png)
VPN服务器配置成功后,还需要帐号连接。创建一个名为bqhvpn1的用户-属性-允许拨入。
四、配置VPN连接帐号:
1、点击“配置”-“本地用户和组”-“用户”
![](https://img-blog.csdnimg.cn/img_convert/466edc9573a62672f5a29daee9dd6ed0.png)
2、在“用户”上点击右键选择“新用户”,输入“用户名”和“密码”在选译“用户不能更换密码”和“密码永不过期”,点击“创建”,在点击“关闭”
![](https://img-blog.csdnimg.cn/img_convert/bf2e0de3f9db79976edaea3762123edf.png)
3、双击新增加的用户“pcvpn”弹出“属性”窗口,选择“拨入”-“网络访问权限”-“允许访问”点击“确定”
![](https://img-blog.csdnimg.cn/img_convert/3aa5f080441a44bfd18aa7770391e7c2.png)
现在VPN服务器已全部完成配置,可以用添加的用户登陆VPN服务器了。
在客户端配置连接方式:
1、打开网络共享中心,选择设置新的连接或网络...
![](https://img-blog.csdnimg.cn/img_convert/7a468fd48441a9fb4d909eba84809d5f.png)
![](https://img-blog.csdnimg.cn/img_convert/8d3a5be0c8c12252f9f1eaf7f6cbc1c5.png)
![](https://img-blog.csdnimg.cn/img_convert/daee17d1ff6fc87f3232ebdbf4dab6d6.png)
![](https://img-blog.csdnimg.cn/img_convert/587d7cc74ce51348db9226f539a939ec.png)
![](https://img-blog.csdnimg.cn/img_convert/e0019f47c8371c9b91d7ea89f1ffc9b6.png)
![](https://img-blog.csdnimg.cn/img_convert/de7f19c513cc60631bab8a545d840c3b.png)
![](https://img-blog.csdnimg.cn/img_convert/ffff6d7a99ff50098237f8525d92f009.png)
![](https://img-blog.csdnimg.cn/img_convert/8a12b19c5419be057d8cb5d1c2ff31eb.png)
![](https://img-blog.csdnimg.cn/img_convert/3b9df2a013f0726bfdda4c152bbae9aa.png)