非常簡單版…
Download
http://openvpn.net/download.html
Environment:
Server : idler.no-ip.org, server, linux
Hall computer name: sagittarius, WinXP
At server
run the following command:
cd /usr/share/openvpn/easy-rsa/
. ./vars
./clean-all
./build-ca # Enter the information as required
Country Name (2 letter code) [KG]:
State or Province Name (full name) [NA]:
Locality Name (eg, city) [BISHKEK]:
Organization Name (eg, company) [OpenVPN-TEST]:
Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your server's hostname) []:OpenVPN-CA
Email Address [me@myhost.mydomain]:
./build-key-server server
./build-key sagittarius
./build-dh
transfer ca.crt sagittarius.crt sagittarius.key to sagittarius (3 files), use a secure way.
mv ca.crt dh1024.pem server.crt server.key /etc/openvpn/
vi /etc/openvpn/server.conf
------------------------------------------------
port 1194
proto udp # You may use TCP
dev tun # tun for routing, tap for bridging
ca ca.crt
cert server.crt
key server.key
dh dh1024.pem
server 172.16.0.0 255.255.255.0 # Assign subnet
ifconfig-pool-persist ipp.txt # Record of client, used when OpenVPN goes down or is restarted, then reconnect them
push "route 192.168.0.0 255.255.255.0" # Let client route according these
push "route 10.0.0.0 255.255.255.0"
push "dhcp-option WINS 172.16.0.1" # Let client use this WINS server
client-to-client # Allow client see client
keepalive 10 120
;comp-lzo # Don't enable, it is terrible slow
user nobody
group nobody
persist-key
persist-tun
status openvpn-status.log
verb 3
------------------------------------------------
cd /etc/openvpn
ln -s server.conf openvpn.conf
/etc/init.d/openvpn restart
At client running windows XP, goto C:\Program Files\OpenVPN\config
create client.ovpn, use notepad edit it.
------------------------------------------------
client
dev tun
proto udp
remote idler.no-ip.org 1194
remote www.pcinhk.com 1194 # They are same but as back up for ddns resolving failure
remote-random # random choose
resolv-retry infinite
nobind
persist-tun
ca ca.crt
cert sagittarius.crt
key sagittarius.key
;comp-lzo
verb 3
------------------------------------------------
Start it as services called "OpenVPN". If it get connected, then test it with ping, then test with samba.
For details, let's see http://openvpn.net/howto.html |