Update
Loading...
, ,

How To Install PPTP VPN in Centos

connect to PPTP vpn
The Point-to-Point Tunneling Protocol (PPTP) is a method for implementing virtual private networks. PPTP uses a control channel over TCP and a GRE tunnel operating to encapsulate PPP packets.
More about pptp vpn here http://en.wikipedia.org/wiki/Point-to-Point_Tunneling_Protocol


And now Simple way how to install PPTP VPN in your vps server (Centos)

1. check PPP active in your server
cat /dev/ppp
If message below, your can continue
cat: /dev/ppp: No such device or address
2. Install PPTPD VPN Server
yum install ppp
wget http://poptop.sourceforge.net/yum/stable/rhel5/i386/pptpd-1.3.4-2.rhel5.i386.rpm
rpm -ivh pptpd-1.3.4-2.rhel5.i386.rpm
3. Edit IP setttings
vi /etc/pptpd.conf
add line below
localip 10.8.0.1
remoteip 10.8.0.10-20
enter custom for more ip address ex  10.8.0.100-200

save and exit.

4. Add DNS Server
vi /etc/ppp/options.pptpd
add line below
ms-dns 8.8.8.8
ms-dns 4.2.2.1
save and exit

5. Now, you can add user account and password

vi /etc/ppp/chap-secrets  
# Secrets for authentication using CHAP
# client server secret IP addresses
username pptpd password *
save and exit

6. Setup Forwarding (Enable network forwarding)
nano /etc/sysctl.conf
change ‘net.ipv4.ip_forward’ from 0 to 1

7. Configure iptables to do NAT
If XEN/Dedicate:
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
and if OpenVZ:
iptables -t nat -A POSTROUTING -o venet0 -j SNAT –to-source x.x.x.x
change x.x.x.x with your IP Server

8. change  NAT rule untuk iptables to configure firewall

iptables -A INPUT -i eth0 -p tcp –dport 1723 -j ACCEPT
iptables -A INPUT -i eth0 -p gre -j ACCEPT
iptables -A INPUT -m state –state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i ppp+ -o eth0 -j ACCEPT
iptables -A FORWARD -i eth0 -o ppp+ -j ACCEPT
iptables -I FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
service iptables save
service iptables restart

9. Start PPTP VPN server
service pptpd start
For log pptp server  /var/log/messages


NOTE:
You must add this command in your terminal
iptables -I FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
if you feel there are website not loading anyway (ex you load speedtest.net, kompas.com, twitter images, or anything website) see there 

Source: http://jadoel.info/2013/08/cara-install-pptp-vpn-di-centos-5-vps/

You Might Also Like

0 komentar