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
1 | rpm -ivh http: //acelnmp .googlecode.com /files/pptpd-1 .3.4-1.rhel5.1.x86_64.rpm |
Edit /etc/pptpd.conf to look like
1 2 3 4 | option /etc/ppp/options .pptpd logwtmp localip 172.16.1.1 remoteip 172.16.1.2 |
Edit /etc/ppp/options
1 2 3 4 5 6 7 8 9 10 | name pptpd refuse-pap require-mschap-v2 require-mppe-128 proxyarp lock nobsdcomp novj novjccomp nologfd |
Edit /etc/ppp/chap-secrets
1 | myusername pptpd mypassword * |
Finally start pptpd daemon
1 | /etc/init .d /pptpd start |
2. Client Side
1 | apt-get install pptp |
Edit /etc/ppp/chap-secrets
1 | myusername pptpd mypassword * |
Edit /etc/ppp/peers/myprovider
1 2 3 4 5 6 7 8 | 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
1 | pon myprovider debug dump logfd 2 nodetach |
In both servers, make sure the ports for pptp are open – the default is 1723.