Centos Linux Ubuntu

How to install PPTP on Ubuntu Server and CentOS Server.

Install the PPTP on Ubuntu and CentOS server. The point to point Tunneling protocol is a method for implementing virtual private networks(VPN). The main advantages are it is compatible with most of the mobile devices and it uses less CPU resources. It is not much secure comparing to OpenVPN.

Installation of PPTP on Ubuntu and CentOS:

For Ubuntu:

$sudo apt-get install pptpd

For CentOS:

$ rpm -i http://poptop.sourceforge.net/yum/stable/rhel6/pptp-release-current.noarch.rpm

$ yum -y install pptpd

The configuration examples can be found in the /usr/share/doc/pptpd directory. The configuartion file is /etc/pptpd.conf . The sample configuration may look like:

# See man pptpd.conf to get more information about this file

# pppd options file. By default, /etc/ppp/options is used

option /etc/ppp/options.pptpd

# Server IP in local network


# IP address ranges used to assign IPs to new connecting clients

# Here we define two ranges for our 192.168.1.* subnet: 234-238 and 245


You can change the range here this is an example.

Now add local IP and remoteIP

Edit /etc/pptpd.conf file and add the following details:

$ sudo nano /etc/pptpd.conf


remoteip #100 clients

You can use sudo vi command, I am more relax with sudo nano

You can use your desire IPs here.

The localip should be your IP address of the server and remoteip is your clients IP that connect to it.

Add DNS server in /etc/ppp/pptpd-options

$ sudo nano /etc/ppp/pptpd-options



Setup user account with authentication

Edit /etc/ppp/chap-secrets and add the following details:

$ sudo nano /etc/ppp/chap-secrets

user1 pptpd password1

user2 pptpd password2

user3 pptpd password3

Add all clients with fixed ip addresses (change user1, user2… and password1, password2,.. according to your preference)

Enable IP Forwarding

$ sysctl -w net.ipv4.ip_forward=1

Restart sysctl to enable the changes made

$ sysctl -p /etc/sysctl.conf

 Configure iptables for forwarding

$ iptables --table nat --append POSTROUTING --out-interface ppp0 -j MASQUERADE

$ iptables -I INPUT -s -i ppp0 -j ACCEPT

$ iptables --append FORWARD --in-interface eth0 -j ACCEPT

$ service iptables save

To makes changes effective, restart PPTP

$ service pptpd restart

Install PPTP on Ubuntu and CentOS has completed.

Leave a Reply

Your email address will not be published. Required fields are marked *