OpenVPN Access Server droplet open port to client though vpn

Posted July 7, 2021 70 views

I have created an OpenVPN server with the one-click droplet installation from the marketplace (without pihole).

My Windows client ( is connected to the OpenVPN server (188.x.x.x). On the Windows client, I have opened port 8080, and I can telnet to on port 8080.

Now I have to setup my OpenVPN server, to forward port 8080 to my Windows client, so that if people connect to 188.x.x.x:8080 they will connect to my Windows client.

I have no experience with Ubuntu/Linux distibution, so I tried to follow some steps from this tutorial:

Basically what I did on the OpenVPN server is this:

iptables –table filter –list INPUT –line-numbers

iptables –table filter –insert INPUT 6 –protocol tcp –dport 8080 –jump ACCEPT

iptables –table filter –list FORWARD –line-numbers

iptables –table filter –insert FORWARD 3 –protocol tcp –destination –jump ACCEPT

iptables –table nat –append PREROUTING –protocol tcp –dport 8080 –jump DNAT –to-destination

iptables –table nat –list POSTROUTING –line-numbers


1 SNAT tcp – anywhere tcp dpt:8080 to:188.x.x.x
2 AS0NATPOSTRELEST all – anywhere anywhere state RELATED,ESTABLISHED
3 AS0NATPRE all – anywhere anywhere mark match 0x2000000/0x2000000

To be honest, I have no idea what I just did, but the port is not open when I try to connect to 188.x.x.x:8080 and the result from iptables –table nat –list POSTROUTING –line-numbers seems like the is wrong to me, but I have no idea what I did wrong or how to fix it.

Can someone please point me in the right direction. I have tried to find some other tutorials but it seems like I use the wrong terms to find it.


Submit an answer

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!