Port forwarding from OpenVPN Client to Public Internet

I need to forward port 44444 of my VPN client to the public internet with my public IP on port 44444, how i can do this?

The VPN Server is mine and I have root access.

Example how i can do this? WANIP:44444-> 172.27.224.2:44444 (VPN LOCAL IP) ?

I'm trying with this but no success:

sysctl net.ipv4.ip_forward=1
iptables -t nat -A PREROUTING -d WANIP -p tcp --dport 44444 -j DNAT --to-destination 172.27.224.2:44444
iptables -t nat -A POSTROUTING -d 172.27.224.2 -p tcp --dport 44444 -j SNAT --to-source WANIP

Interface of WAN IP is eth0 and Interface of VPN LOCAL IP is as0t0

2 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like