Page 1 of 1

redirect port

Posted: Wed Sep 13, 2023 1:57 am
by jtvpn
Hi,

I have the running the OpenVPN server community version 2.5.5 with no issue so far :D

I have been trying to port forward the port 80 and 443 by using ufw without a success (line bellow). Is any tutorial on how to do it?

Code: Select all

*nat
:PREROUTING ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
-A POSTROUTING -s 10.10.0.0/24 -o eth0 -j MASQUERADE
-A PREROUTING -p tcp -i eth0 --dport 443 -j DNAT --to-destination 10.10.0.5:443
-A PREROUTING -p tcp -i eth0 --dport 80 -j DNAT --to-destination 10.10.0.5:80

Re: redirect port

Posted: Wed Sep 13, 2023 10:08 am
by jtvpn
All fixed :D

The correct syntax will be as follow:

Code: Select all

*nat
:POSTROUTING ACCEPT [0:0]
-A PREROUTING -p tcp --dport 443 -j DNAT --to-destination 10.10.0.5:443
-A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 10.10.0.5:80

-A POSTROUTING -s 10.10.0.0/24 -j MASQUERADE