Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Road Warrior VPN Setup Plus Port Forward

Today i will show you how to setup and install openvpn plus portforward on your vps or dedicated server, since there are so many people asking about vpns and safety.

Step 1. Is buy a vps or dedicated server from a reputable provider

Step 2. Connect to your vps/dedictaed server as follows download putty from Putty Here

[Image: a033f87ca4bd464cc90d5e16c53b0130.png]

Step 3. Install Git

Code
apt-get install git #Debian/ubuntu
yum install git #Centos

Step 4. Get the road warrior install of openvpn

[Image: cd4cd6fff2254bc83d663ff031e4cfe1.png]

Code
git clone https://github.com/Nyr/openvpn-install.git


Step 5. Install openvpn using the script

Code
cd openvpn-install && chmod +x openvpn-install.sh && ./openvpn-install.sh

Answer the following questions:
Public ip/Hostname Would be your server ip here
UDP or TCP
[Image: 49d1b0d2fbd14392d1e532648ae77078.png]
Port listening on:[Image: 9461cdc52561b68f49e4fa2965f5afa9.png]
Select your DNS provider:
[Image: 9009a88208d06433a786c78599257343.png]
Finally Client name of certificate:
[Image: 71474b04a81391df476733771160eac3.png]

Step 6. Run openvpn-install.sh again
[Image: 5746d1135520d944dea4801a61fd30c1.png]

Step 7. Connect to server with winscp or ftp client on port 22 get the client.ovpn file
[Image: 5d3e48aa8c4324e8237a93cca77e59b9.png]

Step 8. Port forward 10.1.134.110 would be your openvpn client ip
Code
iptables -t nat -A PREROUTING -p tcp --dport 28006 -j DNAT --to 10.1.134.110

Thanks Digital you helped me out a lot send you some bytes
Great Tutorial !
You save my cost and time.I had tried many forums and web but nobody answer me properly.Only your tutorial make fulfill my needs.
Thanks for your tutorial.Hope you will share more tutorials about VPN like how to secure and build no logs VPN.
Best wishes to you.have a nice day!
How can i apply this to ratting ?
(Dec 14, 2019 04:06 AM)Fr3eD0M Wrote:  Great Tutorial !
You save my cost and time.I had tried many forums and web but nobody answer me properly.Only your tutorial make fulfill my needs.
Thanks for your tutorial.Hope you will share more tutorials about VPN like how to secure and build no logs VPN.
Best wishes to you.have a nice day!

Glad i could save you some time and money with the tutorial and yes there is a way to look for the logs which will be located /var/log/openvpn
(Dec 14, 2019 07:58 AM)__Digital__ Wrote:  Glad i could save you some time and money with the tutorial and yes there is a way to look for the logs which will be located /var/log/openvpn

Yes ! I have found it.If I delete that from my server then is it enough ? or Do I have to add these lines too ?

log /dev/null
status /dev/null
verb 0

Or Do I have to do both( delete that file and add these lines )
Thanks for your kind response
Very nice tutorial. I was looking for something like that. Thank you
Thanks for this. Might come in handy! Appreciated.
HF Member Since 2010
this is really good tuts... really appreciate this.. thanks
This is very good,informative and helpful tutorial.But,I have faced a problem.Do you help me brother please.............
1. How can we check which ports are open now after opening many ports I can't remember them for my bad memory :(.
2. And How can I close individual port and port range?  from command line.

If you have some times please, Make a tutorial how to use won (Domain)dns for RAT instead of free ( like no-ip,duck-dns).I used freedns.afraid but they have locked/ban my account after 4 days later ( Screenshot https://prnt.sc/rlb0k2 ).
Please,Make a tutorial about this topic brother.It will be great help for newbie like me.
Best wishes to you.
Kind regards
(Mar 23, 2020 09:24 AM)Kindness Wrote:  This is very good,informative and helpful tutorial.But,I have faced a problem.Do you help me brother please.............
1. How can we check which ports are open now after opening many ports I can't remember them for my bad memory :(.
2. And How can I close individual port and port range?  from command line.

If you have some times please, Make a tutorial how to use won (Domain)dns for RAT instead of free ( like no-ip,duck-dns).I used freedns.afraid but they have locked/ban my account after 4 days later ( Screenshot https://prnt.sc/rlb0k2 ).
Please,Make a tutorial about this topic brother.It will be great help for newbie like me.
Best wishes to you.
Kind regards

Just buy a domain and park it, modify the A record to the vpn ip and you will be fine
(Mar 23, 2020 09:29 AM)__Digital__ Wrote:  Just buy a domain and park it, modify the A record to the vpn ip and you will be fine

Thanks for your quick reply,Brother.
But ,In VPN. How can we check how many ports are open now? and how to close a single port and multiple ports through command line
(Mar 23, 2020 09:32 AM)Kindness Wrote:  Thanks for your quick reply,Brother.
But ,In VPN. How can we check which ports are open now? and close a single port and multiple ports through command line

Ports are closed by default unless you open them using the commands provided. You can open a rage using iptables command.

Code
iptables -A INPUT -p tcp --dport 1000:2000 will open up inbound traffic to TCP ports
(Mar 23, 2020 09:38 AM)__Digital__ Wrote:  Ports are closed by default unless you open them using the commands provided. You can open a rage using iptables command.

Code
iptables -A INPUT -p tcp --dport 1000:2000 will open up inbound traffic to TCP ports


I used this command for open port 6240


Code
iptables -t nat -A PREROUTING -p tcp --dport 6240 -j DNAT --to 10.8.0.2

In this way I have opened more than 10 ports
then saved this settings with this command:
Code
dpkg-reconfigure iptables-persistent
 

then I used this command :
Code
iptables -L

to see if it is in open list.But,It doesn't show in terminal.

Note: All ports  are opened successfully and usable. When I have followed your above instructions.
But Before reading your  tutorial I used  these commands to open ports:
Code
iptables -A INPUT -p tcp -m tcp --dport 8800:8888 -j ACCEPT
iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 8800:8888 -j DNAT --to-destination 10.8.0.2
iptables -t nat -A POSTROUTING -d 10.8.0.2/32 -o tun0 -p tcp -m tcp --dport 8800:8888 -j SNAT --to-source 10.8.0.1
dpkg-reconfigure iptables-persistent

And When I used this  command :
Code
iptables -L

It shows all opened ports and port ranges like this screenshot  : https://prnt.sc/rlc52l

But It doesn't shows these ports in the terminal what I have opened using your tutorial.Is there any commend to show which ports I opened using this command/Tutorials command:
Code
iptables -t nat -A PREROUTING -p tcp --dport 28006 -j DNAT --to 10.1.134.110

I am sorry for wasting your valuable times.Forgive me brother.
(Mar 23, 2020 10:35 AM)Kindness Wrote:  I used this command for open port 6240


Code
iptables -t nat -A PREROUTING -p tcp --dport 6240 -j DNAT --to 10.8.0.2

In this way I have opened more than 10 ports
then saved this settings with this command:
Code
dpkg-reconfigure iptables-persistent
 

then I used this command :
Code
iptables -L

to see if it is in open list.But,It doesn't show in terminal.

Note: All ports  are opened successfully and usable. When I have followed your above instructions.
But Before reading your  tutorial I used  these commands to open ports:
Code
iptables -A INPUT -p tcp -m tcp --dport 8800:8888 -j ACCEPT
iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 8800:8888 -j DNAT --to-destination 10.8.0.2
iptables -t nat -A POSTROUTING -d 10.8.0.2/32 -o tun0 -p tcp -m tcp --dport 8800:8888 -j SNAT --to-source 10.8.0.1
dpkg-reconfigure iptables-persistent

And When I used this  command :
Code
iptables -L

It shows all opened ports and port ranges like this screenshot  : https://prnt.sc/rlc52l

But It doesn't shows these ports in the terminal what I have opened using your tutorial.Is there any commend to show which ports I opened using this command/Tutorials command:
Code
iptables -t nat -A PREROUTING -p tcp --dport 28006 -j DNAT --to 10.1.134.110

I am sorry for wasting your valuable times.Forgive me brother.

I do not understand what issue you are having as you state they are open and working fine when you follow my tutorial. You are probably just over thinking everything. Just port forward the way i stated on the thread then issue iptables-save and it will save your opened ports to iptables.


Possibly Related Threads...
Thread / Author Replies Views Last Post
by hextra6May 4, 2025 07:55 PM 25 2,942 May 4, 2025 07:55 PM
Last Post: ginxforce
by secret1337Jan 17, 2024 07:17 AM 7 621 Jan 17, 2024 07:17 AM
Last Post: flossmymonkey
by CasimiroAug 6, 2022 08:02 PM 13 665 Aug 6, 2022 08:02 PM
Last Post: P1N7