I've been trying really hard to allow a distant pc to access to my web server hosted on a vpn client (openvpn access server).
I'd like to make this setup possible:
The VPS's os is debian 8 btw
I have ip forward enabled
echo 1 > /proc/sys/net/ipv4/ip_forward
I know I will have to use iptables but I've tried adding PREROUTE, POSTROUTE, SNAT and SNAT entries but it was unsuccessfull.
iptables -t nat -A PREROUTING -d 98.76.54.32/32 -p tcp -dport 25565 -j DNAT –to-destination 172.27.240.2
iptables -t nat -A POSTROUTING -s 172.27.240.2/32 -p tcp -dport 25565 -j SNAT –to-source 98.76.54.32
I must be doing something wrong or lacking something...