Pages

Sunday, June 22, 2014

Cara Install PPTP VPN di CentOS 5 VPS

Tutorial Cara Install PPTP VPN server di vps CentOS 5 32bit XEN
  1. Cek dan pastikan PPP aktif
    cat /dev/ppp
    Jika output seperti dibawah ini berarti sudah aktif
    cat: /dev/ppp: No such device or address
    Cara Install PPTP VPN di CentOS 5 VPS 1
  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
    nano /etc/pptpd.conf
    tambahkan berikut dibawah sendiri
    localip 192.168.0.1
    remoteip 192.168.0.101-200
    Cara Install PPTP VPN di CentOS 5 VPS 4
    Simpan dan exit
  4. Menambahkan DNS servers
    nano /etc/ppp/options.pptpd
    ms-dns 8.8.8.8
    ms-dns 4.2.2.1
    Cara Install PPTP VPN di CentOS 5 VPS 5
    Uncomment ‘ms-dns’ dan ganti dns sesuai selera
    lalu simpan dan exit
  5. Menambahkan user account untuk menentukan username and password
    nano /etc/ppp/chap-secrets
    # Secrets for authentication using CHAP
    # client server secret IP addresses
    tes1 pptpd password *
    Cara Install PPTP VPN di CentOS 5 VPS 6
    Simpan dan exit
  6. Setup Forwarding (Enable network forwarding)
    nano /etc/sysctl.conf
    Ganti ‘net.ipv4.ip_forward’ dari 0 jadi 1
    net.ipv4.ip_forward = 1
    Cara Install PPTP VPN di CentOS 5 VPS 7
    Untuk merubahnya bisa juga dengan:
    sysctl -p
  7. Untuk Configure iptables to do NAT
    Untuk XEN/Dedicate:
    iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
    Untuk OpenVZ:
    iptables -t nat -A POSTROUTING -o venet0 -j SNAT –to-source x.x.x.x
    Ganti x.x.x.x dengan IP Server
  8. Membuat 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
    service iptables save
    service iptables restart
  9. Start PPTP VPN server
    service pptpd start
Untuk log pptp server ada di /var/log/messages

0 comments:

Post a Comment