Friday 6 February 2015

HOW TO INSTALL OPENVPN ON CENTOS

How to Install OpenVPN on CentOS 5 & 6 32 / 64bit - One day I bought a vps vps and have not installed anything, I putuskatan to install openvpn on centos os, but then I do not know what what I install openvpn on centos. I can not find that here also, finally a friend tell me that there is in an existing web that discuss how to easily install openvpn, I became immediately to the scene in question and vps web sayapun now can be used for openvpn.

OpenVPN users are now a lot, because I think so good for surf, so stable. To share the Internet can also be used with Connectify hotspot, and others as well. Therefore, the user openvpn far enough.

VPS you want to plug openvpn? Follow yuk following way.

1. Log in via Bitvise open a terminal (xterm), or via putty.
2. Should the root access.

Make sure TUN TAP is active
Enter:
cat / dev / net / tun
Make sure also thanked: File descriptor in bad state
-----------
3. Enter the following command:
CentOS 5 32bit
wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
CentOS 5 64bit
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
CentOS 6 32 bit
wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.i686.rpm
CentOS 6 64bit
wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
ALL CentOS 5
-Import rpm http://apt.sw.be/RPM-GPG-KEY.dag.txt
rpm -K-0.5.2-2.el5.rf RPMForge-release. *. rpm
rpm -i-0.5.2-2.el5.rf RPMForge-release. *. rpm
ALL CentOS 6
-Import rpm http://apt.sw.be/RPM-GPG-KEY.dag.txt
rpm -K-0.5.3-1.el6.rf RPMForge-release. *. rpm
rpm -i-0.5.3-1.el6.rf RPMForge-release. *. rpm
yum -y install openvpn
/usr/share/doc/openvpn-2.2.2/easy-rsa/ cp -r / etc / openvpn /
WATCH CentOS 6
need a little change
yum -y install nano
nano /etc/openvpn/easy-rsa/2.0/vars

Then EDIT following lines:
export KEY_CONFIG = `$ EASY_RSA / whichopensslcnf $ EASY_RSA`
TO BE:
export KEY_CONFIG = / etc / openvpn / easy-rsa / 2.0 / openssl-1.0.0.cnf
Then SAVE (Ctrl + X) (Y) (ENTER)
cd /etc/openvpn/easy-rsa/2.0/
chmod + x *
source ./vars
./vars
./clean-all
./build-ca
Quite Enter All EXCEPT COMMON NAME (fill in as you wish)
then:
./build-key-server server
Pay attention and follow the steps carefully, as it appears notification (two times) select Y (y)
------------
./build-dh
Wait until the process is complete
If you already enter the following:
/etc/openvpn/easy-rsa/2.0/keys/ cp -r / etc / openvpn / keys /
/etc/openvpn/keys/ca.crt cp / etc / openvpn /
cd / etc / openvpn /
Creating Response to TUN driver
paint> << END server.conf
dev tun *
END
MembuatConfigurasi server:
paint> << END vpn.conf
port 110
proto tcp
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
/usr/share/openvpn/plugin/lib/openvpn-auth-pam.so plugin /etc/pam.d/login
client-cert-not-required
username-as-common-name
server 10.9.8.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
5 keepalive 30
comp-lzo
persist-key
persist-tun
the status of the server-tcp.log
verb 3
END
Port forwarding
echo 1> / proc / sys / net / ipv4 / ip_forward
Route iptables rules
iptables -t nat -A POSTROUTING -o -s 10.9.8.0/24 -j SNAT -to venet0 162.218.92.136

KVM VPS:
chkconfig openvpn on
vi /etc/sysctl.conf
look for
find net.ipv4.ip_forward
And change valuenya from 0 to 1 like this
net.ipv4.ip_forward = 1
echo 1> / proc / sys / net / ipv4 / ip_forward
iptables -t nat -A POSTROUTING -s 10.9.8.0/24 -o eth0 -j MASQUERADE
service iptables save
service iptables restart
xxx.xxx.xxx.xxx above replace with your VPS IP
Run VPN on the server:
service openvpn start
Create Client Config:
paint> << END vpn.ovpn
client
dev tun
proto tcp
remote xxx.xxx.xxx.xxx 443
resolv-retry infinite
route-method exe
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
auth-user-pass
comp-lzo
verb 3
END
REMEMBER, replace xxx.xxx with your VPS IP
==============================
Make that ca be accessed via the web:
mkdir / var / www / html / ca
ca.crt cp / var / www / html / ca
-Add chkconfig openvpn ca.crt cp / var / www / html / ca
chkconfig openvpn on
clear
exit
Please file 1194-client downloaded at http: // IpVPSkamu / ca
Example: http://49.213.22.50/ca

No comments:

Post a Comment