0

I have installed PPTPD on my CentOS server and try to connect to it from my Mac and my Android smartphone. Both failed. This is the log on my Mac (from ppp client):

Mon Jun 22 22:11:58 2015 : publish_entry SCDSet() failed: Success!
Mon Jun 22 22:11:58 2015 : publish_entry SCDSet() failed: Success!
Mon Jun 22 22:11:58 2015 : pptp_get_router_address
Mon Jun 22 22:11:58 2015 : pptp_get_router_address 10.0.0.1 from dict 1
Mon Jun 22 22:11:58 2015 : PPTP connecting to server '...' (xxx.xx.xx.xxx)...
Mon Jun 22 22:11:58 2015 : PPTP connection established.
Mon Jun 22 22:11:58 2015 : PPTP set port-mapping for en0, interface: 4, protocol: 0, privatePort: 0
Mon Jun 22 22:11:58 2015 : Using interface ppp0
Mon Jun 22 22:11:58 2015 : Connect: ppp0 <--> socket[34:17]
Mon Jun 22 22:11:58 2015 : PPTP error when reading socket : Connection reset by peer
Mon Jun 22 22:11:58 2015 : PPTP error when reading header : read -1, expected 12 bytes
Mon Jun 22 22:11:58 2015 : PPTP hangup
Mon Jun 22 22:11:58 2015 : Connection terminated.
Mon Jun 22 22:11:58 2015 : PPTP clearing port-mapping for en0
Mon Jun 22 22:11:58 2015 : PPTP disconnecting...
Mon Jun 22 22:11:58 2015 : PPTP disconnected

On the server, my /etc/pptpd.conf looks like this:

option /etc/ppp/options.pptpd
localip 192.168.0.1
remoteip 192.168.0.2-200
listen 000.00.000.00 # Server IP

/etc/ppp/options.pptpd have this contents:

ms-dns 8.8.8.8
ms-dns 4.2.2.2
lock
name pptpd
require-mschap-v2
require-mppe-128

And finally, /etc/ppp/chap-secrets contains one user:

mySecretUser * mySecretPassword *

I try to connect with username mySecretUser and password mySecretPassword of course.

5
  • @MariusMatutiae: I have changed it: remoteip 192.168.0.240-250. What do you mean with 'local DHCP server'? This is a server system.
    – Richard
    Commented Jun 25, 2015 at 15:50
  • Can you pls tell me what are the IPs of your LAN? Commented Jun 25, 2015 at 15:56
  • Pls see my Edit. Commented Jun 25, 2015 at 16:49
  • @MariusMatutiae: Thank you! In 14 hours, you get the bounty. :-)
    – Richard
    Commented Jun 25, 2015 at 16:52
  • 1
    Glad I could help! Commented Jun 25, 2015 at 16:54

1 Answer 1

2
+50

Try as follows: in /etc/pptpd.conf, only these statements

   localip ipv4-ip-of-your-vps
   remoteip 10.0.0.10-100
   ms-dns 8.8.8.8
   ms-dns 8.8.4.4

and nothing else in /etc/ppp/options.pptpd. Now edit /etc/sysctl.conf and edit the line

    net.ipv4.ip_forward = 1

to have a final 1, not 0. Now implement this as

    sysctl -p

Then give the following two commands:

     iptables -P FORWARD ACCEPT
     iptables -t nat -A POSTROUTING -o venet0 -j MASQUERADE

or venet0:1, depending on which one is your default NIC.

EDIT:

the one above is the standard configuration for pptpd, thus, if it does not work, it is because it is conflicting with something else. Unfortunately, the client-side error messages do not help:

 PPTP error when reading socket : Connection reset by peer

is the equivalent of slamming the door onto the client's face, with no detail provided. The only way to troubleshoot this is from the server side: halt the daemon, then restart it with the following command:

    sudo /usr/sbin/pptpd -fd

which will send even more debug messages to /var/log/syslog. Now try to connect to it as before, and kill the server after the failed attempt. Either the terminal, or the file /var/log/syslog will now contain, hopefully, enough details to troubleshoot the problem.

2
  • Thank you for answer, but this changes nothing :-(. I have changed the pptpd.conf (no large changes). Iptables rules were set and ip_forward was set before.
    – Richard
    Commented Jun 25, 2015 at 16:22
  • Thank you for your edit, I have not found a way before to debug it. :-) The problem is, that the kernel module was not loaded correctly... "Sorry - this system lacks PPP kernel support". It works now!
    – Richard
    Commented Jun 25, 2015 at 16:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .