What Is a PPTP VPN?
Virtual Private Networks (VPN) are a tool for allowing secure access to another computer, resources, or files over a typical Internet connection. You can think of VPN as a sort of tunnel, where only the connections with the right certification can pass through to the other side, creating a secure space. For most users, a VPN is just a browser extension or app that helps them browse anonymously. The app you’re using for that is a VPN client — the VPN server is handled by the company running the service. But what I’m going to show you here is how to create and take control of your own PPTP VPN server.
PPTP stands for the Point-to-Point Tunneling Protocol. It’s the most straightforward way of setting up a secure private network, and you can create PPTP VPN server in a few steps and with very little cost. If simple protocols do not work in your region, purchasing or setting up an obfuscated VPN could be your best option. Let’s get started on creating our server.
Step 1. Install PPTPD
If your OS is CentOS/RedHat 6 & CentOS/RedHat 7:
yum install -y ppp perl nano iptables
cd /usr/local/src
wget http://poptop.sourceforge.net/yum/stable/packages/pptpd-1.4.0-1.el6.x86_64.rpm
rpm -Uhv pptpd-1.4.0-1.el6.x86_64.rpm
If you are using Ubuntu:
apt-get update
apt-get install -y pptpd
Step 2. Edit IP Settings
Open files with your favorite editor, we use vim here
nano /etc/pptpd.conflocalip 192.168.0.1
remoteip 192.168.0.101-200 # Replace with your VPS IP
Step 3. Add Usernames and Passwords
nano /etc/ppp/chap-secrets
usernameForuser1 * setpassword1here *
Step 4. Enable network forwarding in /etc/sysctl.conf
echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf
use the following command to apply the change:
sysctl -p
Step 5. Configure routing and firewall
iptables -A INPUT -i eth0 -p tcp --dport 1723 -j ACCEPT
iptables -A INPUT -i eth0 -p gre -j ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -i ppp+ -o eth0 -j ACCEPT
iptables -A FORWARD -i eth0 -o ppp+ -j ACCEPT
If your OS is CentOS/RedHat 6 & CentOS/RedHat 7, using the flowing command for saving:
service iptables save
service iptables restart
Step 6. Start PPTP VPN server
If your OS is CentOS or Redhat, using the following command:
service pptpd restart
If your OS is Ubuntu, using the following command:
systemctl restart pptpd
To start PPTP Daemon automatically when rebooting next time, use the command:
If your OS is CentOS/RedHat 6 & CentOS/RedHat 7:
chkconfig pptpd on
If you are using Ubuntu:
systemctl enable pptpd