How To Setup PPTP VPN On Ubuntu Linux and CentOS

PPTP (Point-to-Point Tunneling Protocol) is one of the oldest VPN protocols,

PPTP (Point-to-Point Tunneling Protocol) is one of the oldest VPN protocols, dating back to the days of Windows 95. It was designed to create Virtual Private Networks (VPNs) by establishing a secure connection over a public network, such as the internet. PPTP works by encapsulating data packets and sending them through a tunnel to a remote server, where they are decrypted and forwarded to their intended destination.

While PPTP was once widely used due to its simplicity and compatibility with various operating systems, it is now considered obsolete and insecure. Several vulnerabilities have been discovered in PPTP, making it susceptible to hacking and data interception. Security agencies like the NSA have been known to exploit these vulnerabilities to monitor PPTP traffic.

Uses of a PPTP Server

1. Remote Access to a Private Network

One of the primary uses of a PPTP server is to provide remote access to a private network. Employees can securely connect to their company’s internal network from anywhere in the world, enabling them to access files, applications, and other resources as if they were physically present in the office.

2. Enhancing Security on Public Networks

Public Wi-Fi networks are notorious for their lack of security. Using a PPTP server, individuals can encrypt their internet traffic, protecting their data from potential eavesdroppers and cybercriminals when connected to public Wi-Fi hotspots.

3. Bypassing Geographical Restrictions

Many online services and websites impose geographical restrictions on their content. By connecting to a PPTP server located in a different region, users can bypass these restrictions and access content that would otherwise be unavailable in their location.

4. Securing Communication for Remote Workers

As remote work becomes increasingly common, securing communication between remote workers and central office servers is crucial. A PPTP server ensures that sensitive data transmitted over the internet is encrypted and protected from interception.

5. Cost-Effective VPN Solution

PPTP servers provide a cost-effective VPN solution for small businesses and individual users who need basic encryption and secure remote access without the complexity and expense associated with more advanced VPN protocols.

How To Setup PPTP Server On Ubuntu Linux and CentOS

Setting up a PPTP (Point-to-Point Tunneling Protocol) server on Ubuntu Linux and CentOS is a straightforward process that allows you to create a VPN (Virtual Private Network) for secure and private connections. This guide provides step-by-step instructions to install and configure a PPTP server on both Ubuntu and CentOS.

Prerequisites

  • A VPS or dedicated server with Ubuntu or CentOS installed.
  • Root access to the server.
  • Basic knowledge of Linux command-line interface.

Step 1: Update the System

Before starting the installation, ensure your system is up-to-date by running the following commands:

Ubuntu:

sudo apt update && sudo apt upgrade -y

CentOS:

sudo yum update -y

Step 2: Install PPTP Server

Ubuntu: Install pptpd package using the following command:

sudo apt install pptpd -y

CentOS: First, you need to enable the EPEL repository:

sudo yum install epel-release -y

Then install

pptdp

sudo yum install pptpd -y

Step 3: Configure PPTP Server

Edit PPTP Configuration File

Ubuntu and CentOS: Open the pptpd.conf file in a text editor:

sudo nano /etc/pptpd.conf

Add the following lines at the end of the file to specify the local and remote IP addresses for the VPN clients:

localip 192.168.0.1
remoteip 192.168.0.100-200
  • localip is the IP address of the server.
  • remoteip is the range of IP addresses that will be assigned to the VPN clients.

Configure DNS Servers

Edit the pptpd-options file to set the DNS servers:

sudo nano /etc/ppp/pptpd-options

Add the following lines:

ms-dns 8.8.8.8
ms-dns 8.8.4.4
  • These are Google’s public DNS servers. You can replace them with your preferred DNS servers.

Create VPN Users

Edit the chap-secrets file to add VPN users:

sudo nano /etc/ppp/chap-secrets

Add the following lines for each user:

username pptpd password *
  • Replace username and password with your desired credentials.

Step 4: Enable IP Forwarding

Ubuntu and CentOS: Edit the sysctl.conf file:

sudo nano /etc/sysctl.conf

Uncomment or add the following line:

net.ipv4.ip_forward = 1

Apply the changes:

sudo sysctl -p

Step 5: Configure Firewall

You need to allow traffic on the PPTP port (1723) and enable IP masquerading.

Ubuntu (using UFW):

sudo ufw allow 1723/tcp
sudo ufw enable

CentOS (using firewalld):

sudo firewall-cmd --permanent --add-port=1723/tcp
sudo firewall-cmd --permanent --add-masquerade
sudo firewall-cmd --reload

Step 6: Start and Enable PPTP Service

Ubuntu:

sudo systemctl start pptpd
sudo systemctl enable pptpd

CentOS:

sudo systemctl start pptpd
sudo systemctl enable pptpd

Step 7: Verify the PPTP Server

To verify that the PPTP server is running correctly, use the following command:

sudo systemctl status pptpd

You should see the service status as active (running).

Conclusion

You have successfully set up a PPTP server on Ubuntu and CentOS VPS. Your VPN server is now ready to accept connections from VPN clients. Remember that PPTP is considered less secure than other VPN protocols like OpenVPN or L2TP/IPSec, so consider your security needs before deploying it in a production environment.