Page 1 of 1

Change PPTP client and server port

Posted: Tue Apr 14, 2015 4:03 pm
by ibm
Is it possible to specify another tcp port instead of 1723 in PPTP client and server?

Re: Change PPTP client and server port

Posted: Tue Apr 14, 2015 8:07 pm
by ZeroByte
You could use src/dst nat rules to manipulate the packet headers.

Re: Change PPTP client and server port

Posted: Tue Apr 14, 2015 8:57 pm
by ibm
I tried the following but they don't work
server side:
add action=redirect chain=dstnat disabled=yes dst-port=1723 in-interface="ether1 - WAN" protocol=tcp to-ports=5000

client side:
add action=src-nat chain=srcnat disabled=yes dst-address=5.5.5.5 dst-port=1723 protocol=tcp to-addresses=5.5.5.5 to-ports=5000

Re: Change PPTP client and server port

Posted: Tue Apr 14, 2015 9:57 pm
by ZeroByte
I tried the following but they don't work
server side:
add action=redirect chain=dstnat disabled=yes dst-port=1723 in-interface="ether1 - WAN" protocol=tcp to-ports=5000

client side:
add action=src-nat chain=srcnat disabled=yes dst-address=5.5.5.5 dst-port=1723 protocol=tcp to-addresses=5.5.5.5 to-ports=5000
On the server side, you have to map 5000 back to 1723, so reverse those.

Re: Change PPTP client and server port

Posted: Tue Apr 14, 2015 10:31 pm
by ibm
Yes, I made a mistake when rewriting rules but I applied that yours with no success.
As you can see in the image the server doesn't receive nothing on 5000.

Image

Re: Change PPTP client and server port

Posted: Tue Apr 14, 2015 10:50 pm
by ZeroByte
Is the in-interface correct?
Also - is the to-address correct? (it's blacked out, so I have to ask)

Re: Change PPTP client and server port

Posted: Tue Apr 14, 2015 10:57 pm
by ibm
Is the in-interface correct?
Also - is the to-address correct? (it's blacked out, so I have to ask)
Yes, it's correct, I also tried to not specificate the in-interface.
The 2 address are the same so the port is correctly changed but on the server no packets arrive.
If I use a browser to test ipofserver:5000 I see the packets so I thing that the problem is the source nat.
On the client the interface with source nat has also a masquerading rule but is on the bottom.

Re: Change PPTP client and server port

Posted: Thu Jul 12, 2018 9:10 am
by dangucci
any solution for this? server side is ok using redirect nat rule but client side port has to be changed using firewall rules. Works fine with linux .. someone please help