文给大家介绍一下如何在Windows Mobile上使用OpenVPN. OS:Windoze Mobile 6.0 OpenVPN client:2.1.0 有时候在外面,又有急事需要登录公司内网,一点办法都没有.如果在手机上能拨通OpenVPN的话,可以处理一些简单的事情. 先去OpenVPN官方网站下载客户端程序: http://ovpnppc.ziggurat29.com/ovpnppc-main.htm安装很简单,就不多作介绍了. 我是安装在StorageCard上的,因此安装目录在\Storage Card\Program Files\OpenVPN,里面有一个config的目录,就是放配置文件的地方.默认安装后有一个sample.ovpn文件,配置例子,可以打开参考一下. 其实配置很简单,我因为电脑上安装有openvpn, 后来发现电脑上的配置文件和手机上的基本相同,不同的只是key的路径不同,比如ca.crt,电脑上设置是: ca ca.crt 而PPC上设置为: ca “\\Storage Card\\Program Files\\OpenVPN\\config\\ca.crt”(注意斜杠是成双的) 还有一点不同的是电脑上区分多个连接是把每个连接的配置文件放在不同目录里,按照目录名来区分;而ppc上则是放在同一目录里,用不同的.ovpn后缀文件名来区分. 下面是我的配置文件: ============================================== #this is a sample configuration file that I have used successfully. I included it #as a reference baseline that can be used when testing. remote x.x.x.x 1194 client proto udp nobind dev tap comp-lzo verb 3 resolv-retry infinite persist-key persist-tun #explicit Windows Connection Manager provider selection; like what is on #the Settings 2 tab, but can be set here in the config file. Use either #the provider name or GUID (if you know it). The 1 indicates ‘exclusive’. ;conmgr “Sprint” 1 ;conmgr {F079757F-9357-4000-8305-9CA6B9B6CAEC} 1 #especially if we are using the connection manager ‘exclusive’, then you’ll #need to redirect the gateway since the connection provided by connection #manager will be otherwise unavailable (i.e., ‘exclusive’). You’ll probably #need to specify an alternate DNS server as well. These can be pushed from #the server, or if you don’t want to push them you can explicitly set them #here in the client file ;redirect-gateway def1 ;dhcp-option DNS 192.168.173.1 #crypto certificate stuff================================ #In version 2.1, you can put the files inline using an xml-esque syntax. #Shown here is the syntax (with the equivalent old-style form commented out). #Essentially, you copy the contents of the relevant file here, between #the tags. #Note, the crypto files included here are the openvpn test files and #are for demonstration only. #The CA’s certificate================== ca “\\Storage Card\\Program Files\\OpenVPN\\config\\cac0.crt” #The vpn client’s certificate========== cert “\\Storage Card\\Program Files\\OpenVPN\\config\\c0.crt” #The vpn client’s private! key========= key “\\Storage Card\\Program Files\\OpenVPN\\config\\c0.key” ======================================================= 现在来测试一下连接: 先连接好WiFi,打开安装的OpenVPN客户端,会自动缩小到桌面托盘上,点一下图标,见下图: