Recently I was looking for a solution which would allow me to transfer files and make mysql db connection securely between to servers with public IP address located in different hosting companies. That is when i decided to try out pptp – one of the machine is CentOS (pptp server) and the other one is Ubuntu (pptp client). Here goes the setup –

1. Server side

Install pptpd

rpm -ivh http://acelnmp.googlecode.com/files/pptpd-1.3.4-1.rhel5.1.x86_64.rpm

Edit /etc/pptpd.conf to look like

option /etc/ppp/options.pptpd
logwtmp
localip 172.16.1.1
remoteip 172.16.1.2

Edit /etc/ppp/options

name pptpd
refuse-pap
require-mschap-v2
require-mppe-128
proxyarp
lock
nobsdcomp
novj
novjccomp
nologfd

Edit /etc/ppp/chap-secrets
myusername pptpd mypassword *

Finally start pptpd daemon

/etc/init.d/pptpd start

2. Client Side

apt-get install pptp

Edit /etc/ppp/chap-secrets
myusername pptpd mypassword *

Edit /etc/ppp/peers/myprovider

pty "pptp xx.xx.xx.xx --nolaunchpppd" ###xx.xx.xx.xx: remote host IP
name myusername
remotename PPTP
require-mppe-128
file /etc/ppp/options.pptp
ipparam myprovider
mru 1412
mtu 1412

Finally, connect to pptp server with

pon myprovider debug dump logfd 2 nodetach

In both servers, make sure the ports for pptp are open – the default is 1723.