I’ve a digital server occasion on a cloud with Ubuntu 18.04 operating on it which has public ip 123.456.789.100 (dummy ip right here). I put in OpenVPN server which has added personal ip of digital server occasion as 22.214.171.124 (dummy ip right here). I linked my native machine to vpn and received ipv4 handle 126.96.36.199 (dummy ip right here). I’m able to ping server to my native machine as they’re in the identical vpn and I’m able to ping server on 188.8.131.52
I’ve hosted XAMPP server on native machine(home windows) and I would like if a shopper goes to 123.456.789.100 then it ought to internally route the site visitors to my native machine as its lively and i’m able to ping.
I attempted the next port forwarding but it surely didnt work.
iptables -t nat -A PREROUTING -p tcp –dport 8080 -j DNAT –to-destination 184.108.40.206:8080
iptables -t nat -A POSTROUTING -j MASQUERADE
Picture of the insfra is under: https://i.stack.imgur.com/6bLr1.png
What ought to I do to attain the above state of affairs?