LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   pptpd server (https://www.linuxquestions.org/questions/linux-networking-3/pptpd-server-4175458505/)

!! hack-back !! 04-18-2013 05:17 PM

at first i do what is in this guide
http://freehostinganswers.com/blog/h...at-and-ubuntu/

warez74 04-18-2013 05:21 PM

Add the following iptable rules:

iptables -t nat -A PREROUTING -d x.x.x.x -p tcp --dport 81 -j DNAT --to x.4.252.69
iptables -t nat -A PREROUTING -d x.x.x.x -p tcp --dport 3460 -j DNAT --to x.4.252.69

where x.x.x.x is IP address of your public server. (dont forget to change the "x" with proper number in the x.4.252.69)

!! hack-back !! 04-18-2013 05:35 PM

now i cant access my server from my ip iam waiting softlayer to answer me why lol :(

warez74 04-18-2013 05:40 PM

?

One thing... the localip and the remoteip (pptpd.conf) should be IP addresses from private range e.g.:
localip 10.10.10.2
remoteip 10.10.10.1

Does that goes for your case?

warez74 04-18-2013 05:41 PM

btw, I hope you did not set the public ip of your PC as a remoteip.

!! hack-back !! 04-18-2013 05:46 PM

my laptop ip is x.4.252.69
my server ip is x.173.180.202

!! hack-back !! 04-18-2013 05:48 PM

Quote:

Originally Posted by warez74 (Post 4934361)
btw, I hope you did not set the public ip of your PC as a remoteip.


hahaha i did that sorry i didnt understand this step very well :doh:

warez74 04-18-2013 05:50 PM

Oh, no :(

You made a common mistake in pptpd.conf

find the place in pptpd.conf where the localip/remoteip are specified and edit it to be like this:

localip 10.10.10.2
remoteip 10.10.10.1

Then when you get access to your server again, add the following iptables rules:

iptables -t nat -A PREROUTING -d x.173.180.202 -p tcp --dport 81 -j DNAT --to 10.10.10.1
iptables -t nat -A PREROUTING -d x.173.180.202 -p tcp --dport 3460 -j DNAT --to 10.10.10.1

!! hack-back !! 04-18-2013 05:54 PM

ok i edited thanks
i can access it through free vpn
but i cant access from my ip i dont know why but i put ticket for softlayer.com
waiting them to finish so that i can test with these rules

!! hack-back !! 04-18-2013 05:57 PM

how i can disconnect ppp0
??? vpn account connected to the server

!! hack-back !! 04-18-2013 06:02 PM

i solved the problem /etc/init.d/pptpd restart-kill
that because i put my ip in remote ip lol
the softlayer still searching for the problem :P

!! hack-back !! 04-18-2013 06:05 PM

you are my super man :D
i love you man :D :hattip:
thanks alot

!! hack-back !! 04-18-2013 06:07 PM

if i make more than 1 vpn account
all of them will take 10.10.10.1
so that i can put
remoteip 10.10.10.1-200

right ?

!! hack-back !! 04-18-2013 06:08 PM

and in iptables
iptables -t nat -A PREROUTING -d 184.173.180.202 -p tcp --dport 82 -j DNAT --to 10.10.10.1-200
??

warez74 04-18-2013 06:09 PM

No, wait.

You can remove the last added iptables rules.

First enter this:

iptables -t nat -L --line-numbers

you should get something like this:

Chain PREROUTING (policy ACCEPT)
num target prot opt source destination
1 DNAT tcp -- anywhere landings.nyc.trafficz.com tcp dpt:81 to:10.10.10.1

Notify "1" under below the "num" field. You should use that rule number (in your case it can be different) to delete the previous added rules:

Then enter:
iptables -t nat -D PREROUTING 1

where "1" is the number that you found for "destination" x.173.180.202


All times are GMT -5. The time now is 11:08 PM.