Port forwarding using OpenVPN client

Post Reply
OpenVpn Newbie
Posts: 1
Joined: Sat Jun 16, 2018 12:00 pm

Port forwarding using OpenVPN client

Post by kymy8888 » Sat Jun 16, 2018 12:04 pm


I have a OpenVPN access server version 2.5 and a client configured with a site-to-site routing. Both client and server can communicate with each other by using the private IP addresses. On the client, there is an Apache server which listen on port 8081.

The goal is to be able to connect to the OpenVPN server public IP, and have it forward the connection to the client, so that the user can access the Apache server behind.

My current setup is:


Code: Select all

sysctl -w net.ipv4.ip_forward=1

iptables -t nat -A PREROUTING -d 50.xxx.xxx.xxx -p tcp --dport 8081 -j DNAT --to-dest

iptables -t nat -A POSTROUTING -d -p tcp --dport 8081 -j SNAT --to-source
Is there something simple I'm doing incorrectly? Thank you

Post Reply