win7(64位)下使用openvpn的方法

来源:互联网 发布:电脑天猫,淘宝怎么删除 编辑:程序博客网 时间:2024/06/05 03:11

选对安装版本很重要,有人说使用http://openvpn.se/files/install_packages/openvpn-2.0.9-gui-1.0.3-install.exe是可以的,但是我在64位使用2.0.9版本拨号时老是报TAP驱动不成功。

安装时:

Drivers updated successfully.
tapinstall install returned: 0
tapinstall cumulative status: 0
Previous Service REMOVE (if exists)
OpenService failed - 指定的服务未安装。 (0x424)
Service INSTALL
OpenVPN Service installed.
Output folder: C:\Program Files (x86)\OpenVPN
Extract: INSTALL-win32.txt
Extract: license.txt... 100%
Extract: openvpn.ico... 100%

运行时:

Mon Dec 24 05:13:45 2012 us=100076 CreateFile failed on TAP device:
<a HREF="file:////./Global/{459F2028-3FDD-4C84-8645-2C19694D06C0}.tap">\\.\Global\{459F2028-3FDD-4C84-8645-2C19694D06C0}.tap</A><br />

Mon Dec 24 05:13:45 2012 us=100121 All TAP-Win32 adapters on this
system are currently in use.

 

从新找了个支持wi7的2.2版本openvpn-2.2.0-install就可以正常安装上驱动了。http://www.skycn.com/soft/60781.html

安装时必须注意赋予管理员权限执行。

将原先XP上用的脚本都搬迁过来发现用GUI还是拨号正常,但是没有路由了,以为非管理员权限无法增加路由。于是赋予了OpenVPN GUI管理员权限还是加不上路由,查一番资料才发现需在在原先配置文件中增加:

route-method exe  
route-delay 2 
#最后这两行win7如果不加上,就不能启动修改路由,导致拨vpn成功,但是不能通过远程服务器做网关近路内网

这些配置完成后,右键点openvpn gui在桌面右下角图标选择Connect连接。

于是好奇将xp的配置也改成用GUI来拨号发现也是报如下错误:

Sun Dec 23 20:57:32 2012 us=364780 OPTIONS IMPORT: timers and/or timeouts modified
Sun Dec 23 20:57:32 2012 us=364795 OPTIONS IMPORT: --ifconfig/up options modified
Sun Dec 23 20:57:32 2012 us=364807 OPTIONS IMPORT: route options modified

以前用命令直接拨没那两项配置无所谓,如果使用GUI来拨号就必须增加上去。

 

如果OpenVPN server为2.1的最大的改变之一,就是加了一个 script-security参数。如果按我的这篇教程进行安装,但装的是 OpenVPN 2.1 及以上版本的话,记得在 server.conf 中再加上这么一行配置即可:
script-security 3

--route-method    : Which method to use for adding routes on Windows?
                    ipapi (default) -- Use IP helper API.
                    exe -- Call the route.exe shell command.
--script-security level mode : mode='execve' (default) or 'system', level=
                  0 -- strictly no calling of external programs
                  1 -- (default) only call built-ins such as ifconfig
                  2 -- allow calling of built-ins and scripts
                  3 -- allow password to be passed to scripts via env
原创粉丝点击