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

How to properly set up OpenVPN with a VPS (Port Fowarding)

To do this you need:
Putty
A VPS, preferably one from DigitalOcean or [censored] [Debian, Ubuntu and CentOS only]
openvpn-install by Nyr
WinSCP[reccomended]
OpenVPN


1. Log in to your VPS with credentials emailed to you after checkout.
2. Open WinSCP and log in with the same credentials emailed to you and drag the contents inside the openvpn-install-master folder and drag it in to the root of your VPS.
3. Go inside Putty and run: 'wget https://git.io/vpn -O openvpn-install.sh && bash openvpn-install.sh' on the putty console. The setup should be pretty self explanatory.
4. You should see an openvpn file inside the root of your VPS, download this and keep this safe, and make sure you delete it afterwards.

How to port-foward:
Run this on the Putty console: iptables -t nat -A PREROUTING -p udp -d $IP --dport 53 -j REDIRECT --to-port $PORT

- Change $IP with your server's IP
- Change 53 with your desired port
- Change $PORT with the port specified during installation
These changes will not save. To make these settings save go inside the /etc/rc.local file(... from root) and paste the command above exit 0 at the bottom of the file.

How to connect to the VPN you just created:
Drag your OpenVPN config file inside C:\Program Files\OpenVPN\config
Execute OpenVPN Gui and right click on the OpenVPN icon in the taskbar. You should see the OpenVPN config you dragged in to the config folder a moment ago. Hover over the config and click Connect.

Credits go to Yani for assisting me with this and Nyr the creator of the handy openvpn-install script!
[Image: yJh8Ht4.jpg]

Why did you make this if you're having trouble yourself lmao
If I ain't got it, pockets hurting, I'ma rob a person
(Dec 16, 2016 05:48 PM)Description Wrote:  Why did you make this if you're having trouble yourself lmao
OMG haha don't remind me
I can't port foward :(
wont work
[Image: yJh8Ht4.jpg]

So wait does the port forwarding in this tutorial work or not?? lol
(Dec 16, 2016 08:47 PM)Stupid Fool Wrote:  So wait does the port forwarding in this tutorial work or not?? lol

It depends on OS I think.
If I ain't got it, pockets hurting, I'ma rob a person
(Dec 16, 2016 08:48 PM)Description Wrote:  It depends on OS I think.

Noup.

OP iptables rule is wrong. That's why it's not working.
[Image: sig-y84190q.gif]
While this is a cool script and all that, it doesn't really teach you how to set it up, you're teaching people to use a script.
I believe the issue is more with your $IP section, which should be referencing the internal IP address if I remember correctly, rather than the server IP address.
[Image: sig-y84190q.gif]
You don't need to portforward at all, I have been using this script since 2014 and have never had to do it on multiple servers. What errors are you getting?
all very interesting. I have a couple of questions.
I can use a free vps account?

in this way I can have port forwarding (for example on port 443) for Free? without buying a paid vpn? make the purpose clear to me because I am a newbie.


Possibly Related Threads...
Thread / Author Replies Views Last Post
by xScarfaceJun 30, 2020 03:26 PM 5 224 Jun 30, 2020 03:26 PM
Last Post: Smoky
[VPN] by MTSWApr 30, 2020 10:51 PM 0 127 Apr 30, 2020 10:51 PM
Last Post: MTSW
by BusinessNov 18, 2018 02:10 PM 10 437 Nov 18, 2018 02:10 PM
Last Post: Business