Setting up a PPTP VPN on a Linode server is possible, but note that PPTP is outdated and insecure (prone to attacks). Modern alternatives like OpenVPN, WireGuard, or IPsec are recommended. However, if you still need PPTP, here's how to configure it on Ubuntu/Debian:
- Update your system:
sudo apt update && sudo apt upgrade -y
- Install PPTPD:
sudo apt install pptpd -y
Step 2: Configure PPTP VPN
-
Edit the PPTP config file:
sudo nano /etc/pptpd.conf
Add these lines (replace
168.100.1-100with your preferred IP range):localip 192.168.100.1 remoteip 192.168.100.2-100 -
Set DNS servers (edit
/etc/ppp/pptpd-options):sudo nano /etc/ppp/pptpd-options
Add:
ms-dns 8.8.8.8 ms-dns 8.8.4.4 -
Add VPN credentials (edit
/etc/ppp/chap-secrets):sudo nano /etc/ppp/chap-secrets
Format:
username pptpd password *
Step 3: Enable IP Forwarding
Edit /etc/sysctl.conf:
sudo nano /etc/sysctl.conf
Uncomment or add:
net.ipv4.ip_forward=1
Apply changes:
sudo sysctl -p
Step 4: Configure NAT (Firewall Rules)
- Allow PPTP port (1723) and GRE protocol:
sudo iptables -A INPUT -p tcp --dport 1723 -j ACCEPT sudo iptables -A INPUT -p gre -j ACCEPT
- Set up NAT for VPN traffic:
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
- Save rules (if using
iptables-persistent):sudo apt install iptables-persistent -y sudo netfilter-persistent save
Step 5: Start and Enable PPTPD
sudo systemctl restart pptpd sudo systemctl enable pptpd
Step 6: Connect to PPTP VPN
-
Windows:
Go to Settings > Network & Internet > VPN > Add VPN.
Enter your Linode server IP, username, and password. -
Android/iOS:
Add a new PPTP VPN in network settings.
⚠️ Important Security Notes:
- PPTP uses weak encryption (easily cracked).
- If security is a concern, use OpenVPN or WireGuard instead.
- Consider enabling a firewall (UFW) to restrict access:
sudo ufw allow 1723/tcp sudo ufw enable
Troubleshooting
- Check logs:
sudo tail -f /var/log/syslog
- Ensure
pptpdis running:sudo systemctl status pptpd
Better Alternatives on Linode
- WireGuard (Fast & Modern):
sudo apt install wireguard
- OpenVPN (Widely Used):
sudo apt install openvpn
Would you like a guide for WireGuard/OpenVPN instead? Let me know! 🚀
