Mkdir-p/root/software/vpn Cd/root/software/vpn # Download Packages wget http://www.oberhumer.com/opensource/lzo/download/lzo-2.05.tar.gz wget http://swupdate.openvpn.net/community/releases/openvpn-2.2.1.tar.gz # Decompression and Installation Tar zxvf lzo-2.05.tar.gz cd/root/software/vpn/lzo-2.05 ./configure Make Make install Tar zxvf openvpn-2.2.1.tar.gz cd/root/software/vpn/openvpn-2.2.1 ./configure Make Make install # Server-side settings Cp/root/software/vpn/openvpn-2.2.1/easy-rsa/2.0-r/etc/openvpn Cd/etc/openvpn Vim VARs # Change the contents of VARs to Export key_country= "CN" Export key_province= "SH" Export key_city= "Shanghai" Export key_org= "Studyday.net" Export key_email= "Kuco@studyday.net" Export Key_email=kuco@studyday.net Export Key_cn=kuco Export Key_name=kuco Export Key_ou=kuco Export Pkcs11_module_path=kuco Export pkcs11_pin=20110804 source./vars ./clean-all ./BUILD-CA # All the way to the carriage ./build-key-server server # All the way to the return, the last to press two times Y ./build-key client # All the way to the return, the last to press two times Y ./BUILD-DH cp/root/software/vpn/openvpn-2.2.1/sample-config-files/server.conf/etc/openvpn/ Vim/etc/openvpn/server.conf #将 server.conf Content revision to Local 184.82.33.161 Port 1194 Proto UDP Dev Tun Ca/etc/openvpn/keys/ca.crt Cert/etc/openvpn/keys/server.crt Key/etc/openvpn/keys/server.key Dh/etc/openvpn/keys/dh1024.pem Server 10.8.0.0 255.255.255.0 Client-to-client KeepAlive 10 120 Comp-lzo Persist-key Persist-tun Status/etc/openvpn/keys/openvpn-status.log Verb 4 Push "Dhcp-option DNS 10.8.0.1" Push "Dhcp-option DNS 8.8.8.8" Push "Dhcp-option DNS 8.8.4.4" Ifconfig-pool-persist/etc/openvpn/keys/ipp.txt # Modify Iptables Iptables-t nat-a postrouting-s 10.8.0.0/24-o venet0-j Masquerade /etc/init.d/iptables Save /etc/init.d/iptables restart # Start VPN /usr/local/sbin/openvpn--config/etc/openvpn/server.conf--daemon 2, the Windows (client) operation is as follows # download OpenVPN and install Http://swupdate.openvpn.org/community/releases/openvpn-2.2.1-install.exe # Suppose the installation path is D:\Program Files\openvpn # Download the certified files generated on the server to the D:\Program files\openvpn\config\ directory /etc/openvpn/keys/ca.crt /etc/openvpn/keys/client.crt /etc/openvpn/keys/client.key # copy D:\Program Files\openvpn\sample-config\client.ovpn to D:\Program files\openvpn\config\ # Modify D:\Program Files\openvpn\config\client.ovpn # Change the contents of Client.ovpn to Client Dev Tun Proto UDP Remote 184.82.33.161 1194 Persist-key Persist-tun CA ca.crt Cert CLIENT.CRT Key Client.key Ns-cert-type Server Comp-lzo Verb 3 Redirect-gateway DEF1 Route-method exe Route-delay 2 |