Overview and considerations
This guide walks you through deploying a PPTP VPN server on an AWS EC2 instance with practical, step-by-step technical details. It targets site administrators, developers and enterprise operators who need a quick remote-access VPN on AWS. Before starting, understand that PPTP is an outdated and insecure VPN protocol. It is easy to set up and widely supported by legacy clients, but it lacks modern cryptographic safety. For production use or sensitive data, prefer OpenVPN or WireGuard. This tutorial focuses on deployment mechanics and operational hardening for situations where PPTP is required.
High-level architecture
The basic architecture is straightforward:
- One EC2 instance (Linux) acting as the PPTP server.
- An Elastic IP associated with the instance so clients can reliably connect.
- A security group allowing TCP port 1723 and GRE (IP protocol 47).
- Network address translation (NAT) rules on the EC2 instance to route VPN client traffic to the Internet.
Choose the right AMI and instance type
For simplicity use a mainstream Linux AMI such as Ubuntu LTS or Amazon Linux 2. PPTP has low CPU requirements for a few users, so t3.small or t3.micro may suffice for light use. If the workload includes heavy throughput, choose instances with more network bandwidth (e.g., t3.medium or c5.large).
Security group and VPC settings
Create a security group with the following inbound rules:
- TCP 1723 from allowed client networks (or 0.0.0.0/0 for general access, though not recommended).
- Custom Protocol 47 (GRE) from the same client networks. On AWS you may need to specify protocol number 47 in the security group configuration.
- Allow SSH (TCP 22) only from management IP ranges.
Ensure the subnet’s route table and Network ACLs do not block GRE (protocol 47). AWS Network ACLs allow specifying protocol numbers as well.
Provision the EC2 instance and assign Elastic IP
Launch your Linux instance in the chosen subnet. After it is running, allocate and associate an Elastic IP to the instance so your remote clients have a stable public IP to connect to.
Install PPTP server packages
SSH into the instance and install the PPTP server and necessary PPP modules. Here are typical commands for Ubuntu and Amazon Linux 2:
Ubuntu / Debian:
sudo apt update && sudo apt install -y pptpd
Amazon Linux 2 / CentOS (EPEL may be required):
sudo yum install -y pptpd ppp
Make sure the kernel contains ppp and ppp_mppe support. The package installation usually pulls in the required ppp modules. If you plan to use MPPE encryption, ensure the kernel module ppp_mppe is available.
Configure pptpd
Edit the pptpd configuration file to set local and remote IP ranges and options. Typical file locations:
/etc/pptpd.conf — controls localip and remoteip
Edit with the following minimum entries (example):
localip 10.0.0.1
remoteip 10.0.0.100-10.0.0.199
localip is the server-side address given to the PPTP interface; remoteip is the pool assigned to clients. Choose a private range that does not conflict with your VPC subnets.
Setup client authentication
Use /etc/ppp/chap-secrets to define user accounts. The format is:
username server password client_ip
Example entry:
vpnuser pptpd s3cr3tpassword *
Protect chap-secrets permissions so only root can read it:
sudo chmod 600 /etc/ppp/chap-secrets
PPP options and MPPE
Edit /etc/ppp/options.pptpd (or add to /etc/ppp/options) to enforce MPPE and DNS settings. Example lines:
name pptpd
ms-dns 8.8.8.8
ms-dns 8.8.4.4
require-mschap-v2
noccp (optional — disables compression)
To enable MPPE (encryption), ensure the options include:
refuse-eap
require-mppe-128
Note: MPPE is limited compared to modern ciphers. It provides basic encryption, but PPTP remains insecure against determined attackers.
Enable IP forwarding and NAT
To forward client traffic to the Internet, enable IPv4 forwarding and set up NAT rules.
Enable forwarding immediately:
sudo sysctl -w net.ipv4.ip_forward=1
Persist the setting by adding or editing /etc/sysctl.conf:
net.ipv4.ip_forward = 1
Configure iptables to masquerade traffic from the VPN subnet to the public interface. Replace eth0 with your public interface (use ip addr to check):
sudo iptables -t nat -A POSTROUTING -s 10.0.0.0/24 -o eth0 -j MASQUERADE
Allow forwarding in iptables:
sudo iptables -A FORWARD -s 10.0.0.0/24 -j ACCEPT
sudo iptables -A FORWARD -d 10.0.0.0/24 -j ACCEPT
Persist iptables rules across reboots. On Ubuntu you can use iptables-persistent or save/restore scripts. On Amazon Linux you can use the service iptables save mechanism or systemd scripts.
Start and enable the pptpd service
Start the server and configure it to run at boot:
sudo systemctl start pptpd
sudo systemctl enable pptpd
Check status and logs for errors:
sudo journalctl -u pptpd -f (or tail /var/log/syslog)
Troubleshooting common issues
Below are common failure points and how to troubleshoot them:
- GRE packets blocked: If clients connect but cannot pass traffic, ensure Security Group and Network ACL allow protocol 47. Sometimes corporate firewalls block GRE as well.
- MPPE not negotiated: Ensure the ppp_mppe kernel module is present. Check dmesg and syslog for ppp messages. On some distributions you may need additional ppp packages.
- IP forwarding not working: Confirm net.ipv4.ip_forward=1 and iptables masquerading rules are correct. Use tcpdump (sudo tcpdump -i eth0 proto gre or host client_ip) to observe packets.
- Authentication fails: Double-check /etc/ppp/chap-secrets line format and permissions. Logs will show CHAP/MPPE negotiation details.
- Client gets IP but no Internet: Check route table on the client; default route should point to the VPN. Verify iptables NAT matches the VPN IP range.
Operational hardening
Because PPTP is weak, apply these mitigations to reduce risk:
- Limit access by IP ranges in the Security Group so only known client networks or offices can connect.
- Use strong, unique passwords for each user and rotate them regularly.
- Monitor logs for repeated authentication failures and enable automatic blocking (e.g., fail2ban tailored for pppd logs).
- Harden the instance: keep packages updated, minimize running services, and use AWS IAM roles for instance access.
- Consider running PPTP within a dedicated VPC or security boundary to isolate any compromise.
Testing and client configuration
On Windows, create a new VPN connection using PPTP as the type and point it at your Elastic IP. On macOS and most mobile platforms you can add a PPTP connection (note: modern macOS versions removed built-in PPTP support — you may need third-party clients). After connecting, verify that traffic is routed through the VPN by checking public IP (e.g., curl ifconfig.me) and by tracerouting to external hosts. Use tcpdump on the server to observe PPP and GRE negotiation when the client connects.
When to choose other VPN solutions
For long-term and secure deployments, prefer open-source VPN solutions such as OpenVPN or WireGuard. They provide modern cryptography, better performance, and improved security posture. If client compatibility is limited, consider running multiple VPN endpoints: maintain a PPTP endpoint for legacy devices while offering a recommended modern option for current clients.
Summary and next steps
Deploying a PPTP server on AWS EC2 consists of selecting the right AMI and instance, opening TCP 1723 and GRE (protocol 47), installing pptpd and ppp packages, configuring IP ranges and authentication, enabling IP forwarding and NAT, and hardening the instance. Use careful access controls and monitoring to reduce the security risk. When possible, migrate to modern alternatives for better encryption and performance.
For more in-depth VPN deployment guides and managed dedicated IP options, visit Dedicated-IP-VPN.