One-click pptp vpn installation in CentOS 6.5

Source: Internet
Author: User

Many may not be familiar with the PPTP configuration in Linux. Below I have written a simple Shell script, which can be directly saved and executed by pptp. sh.

1. Script: yum remove-y pptpd ppp
Iptables -- flush POSTROUTING -- table nat
Iptables -- flush FORWARD
Rm-rf/etc/pptpd. conf
Rm-rf/etc/ppp
Yum-y install make libpcap iptables gcc-c ++ logrotate tar cpio perl pam tcp_wrappers
Yum-y dkms-2.0.17.5-1.noarch.rpm
Yum-y kernel_ppp_mppe-1.0.2-3dkms.noarch.rpm
Rpm-qa kernel_ppp_mppe
Yum-y ppp-2.4.4-9.0.rhel5.i386.rpm
Yum-y pptpd-1.3.4-1.rhel5.1.i386.rpm
Mknod/dev/ppp c 108 0
Echo 1>/proc/sys/net/ipv4/ip_forward
Echo "mknod/dev/ppp c 108 0">/etc/rc. local
Echo "echo 1>/proc/sys/net/ipv4/ip_forward">/etc/rc. local
Echo "localip 192.168.168.1">/etc/pptpd. conf
Echo "remoteip 192.168.168.2-254">/etc/pptpd. conf
Echo "ms-dns 8.8.8.8">/etc/ppp/options.ppt pd
Echo "ms-dns 8.8.4.4">/etc/ppp/options.ppt pd
Pass = 'openssl rand 6-base64'
If ["$1 "! = ""]
Then pass = $1
Fi
Echo "vpn pptpd $ {pass} *">/etc/ppp/chap-secrets
Iptables-t nat-a postrouting-s 192.168.168.0/24-j SNAT -- to-source 'ifconfig | grep' inet addr: '| grep-V' 127. 0.0.1 '| cut-d:-f2 | awk 'nr = 1 {print $1 }''
Iptables-a forward-p tcp -- syn-s 172.16.36.0/24-j TCPMSS -- set-mss 1356
Service iptables save
Chkconfig iptables on
Chkconfig pptpd on
Service iptables start
Service pptpd start
Echo "Enter the connection password $ {pass }"

2. Set the permission to run chmod + X3 and run:/bin/bash pptp. sh4. VPN user management: directly edit the/etc/ppp/chap-secrets file and add the user name and password in the same format.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.