Is there a way to make pptpd listen for PPTP trafic on a TCP port other than the default 1723 port?
I khow that PPTP uses more then just tcp/1723. It also uses GRE. it's not a problem. just how to change default PPTP TCP port.
And how to configure pptp client on linux to use port other than the default 1723 port I use pptpd on debian.


My understanding of poptop (the pptpd server) is that you are unable to specify a port number for the server without patching the source and recompiling.

Having a look over the source seems to suggest similar

[welby@blackpudding pptpd-1.3.4]$ fgrep PPTP_PORT -R .
./pptpmanager.c:                address.sin_port = htons(PPTP_PORT);
./pptpdefs.h:#define PPTP_PORT                  1723

As you can see it is defined in pptpdefs.h - and as such in order to change this port - you would have to recompile.

It may be possible on the server side to preform an IPTables src-nat to accept connections on another port and redirect this - however I would suspect that the client would still need to be updated.

Is there a requirement to only use PPTP as if other VPN solutions are acceptable you may find openvpn lends its self to your needs better

  • 1
    "It may be possible on the server side to preform an IPTables src-nat to accept connections on another port and redirect this" Could you explain how that would be possible? / provide an example? – caesay Feb 16 '12 at 6:51

Clien is easy: edit /etc/openvpn/openvpn.conf add port 7654 if it's not already there (but it should be). The server is also easy because you can't (unless you edit the source code).

  • Is it possible to use pptp client instead of openvpn client? In another words how to change pptp client default port? – ir01 Jan 1 '12 at 14:54
  • OP was asking about PPTP – sdaffa23fdsf Jul 27 '15 at 12:20

Its a bit late, but I'll post anyway. There was a forum post somewhere I was just reading that says to add a line in at /etc/services, called pptp. just specify the port you want after that and you should be good.

Note: I have not tested this to be correct

"so my line would state pptp [tab][tab]1723/tcp because default is 1723

  • 1
    Posting an answer that you found in a forum somewhere and haven't tested... thanks for the effort, but it's of doubtful value. – Andrew Schulman Feb 4 '14 at 1:27
  • Upvoted because it worked for me on CentOS 6. I commented out the lines for port 1723 and port 1821 (the one I wanted to use) and created two new lines with pptp 1821/tcp and pptp 1821/udp, restarted pptpd and it was now listening to port 1821. Too bad the port on the device in the other end (not Linux) does not support changing the port. – Marios Zindilis Sep 17 '14 at 8:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.