2

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.

ir01
  • 143
  • 2
  • 2
  • 10

3 Answers3

3

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

whmcr
  • 351
  • 1
  • 2
  • 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 06:51
1

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).

chx
  • 1,665
  • 1
  • 16
  • 25
0

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

Joe
  • 11
  • 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 04 '14 at 01: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 08:27