[Linux] Configuring VPN Proxy Server on Ubuntu

Previously, we mentioned how to configure a VPN server on CentOS. Today, let's briefly discuss how to configure a VPN proxy service on Ubuntu. The process of configuring VPN on Ubuntu is similar to CentOS. Here, I will use a DigitalOcean VPS as a test server. The reason for choosing it is simple - because VPS allows complete control over the PPP device and does not require submitting a ticket to customer service for activation. The operating system is Ubuntu Server 12.04.3. All operations are performed after executing "sudo su".

  1. Confirm whether the PPP device or TUN device is installed (skip this step for DigitalOcean VPS).

ls /dev/ppp
ls /dev/net/tun


cat /dev/ppp
cat /dev/net/tun

If it prompts "No such file or directory" or "No such device or address", it means it is not installed. You can request activation by submitting a ticket.

  1. Install pptpd.

apt-get install pptpd

  1. After successful installation, modify the /etc/pptpd.conf file to configure the IP address of the VPN. Write:


Reference configuration#



localip is the local IP, which is the IP of the local machine. remoteip is the IP that will be assigned to the remote host. It is usually set as a continuous IP range.

  1. Modify the /etc/ppp/options.pptpd file to complete the DNS modification of the VPS server.


  1. Edit /etc/ppp/chap-secrets to configure the users for VPN connection. The format is:

username pptpd password *

username represents the username. pptpd represents the service name, usually the default. password represents the password. The asterisk (*) means that all IPs can connect.

  1. Enable IP forwarding by opening /etc/sysctl.conf. After opening the file, find the following content and modify it. If it doesn't exist, please add it.

Enable IP forwarding#



Apply the changes to /etc/sysctl.conf (optional).

sysctl -p

  1. Open the firewall.

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE && iptables-save

  1. Start the pptp VPN service.

service pptpd start

Tutorial provided by DigitalOcean:

Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.