Iptables - Internal/Public forwarding
Hi guys 1 I try to hide my gameserver IP behind another VPS with an IP-IP tunnel. Everything it's set up but still have a issue. I don't know why but with this IP tables configuration I cannot play game because after first packet, each player it's sent to 192.168.168.2 (Gameserver internal IP). I cannot figure why with POSTROUTING commented below all ports give connection time out like there they fly.
126.96.36.199 - exposed IP address from tunnel 192.168.168.2 - Gameserver IP 192.168.168.1 - internal IP of 188.8.131.52
Hope someone will manage this for me. Best regards, Florin. iptables -P INPUT ACCEPT iptables -P OUTPUT ACCEPT iptables -P FORWARD ACCEPT
iptables -F iptables -F -t nat iptables -X iptables -X -t nat iptables -t nat -A PREROUTING -d 184.108.40.206 -p tcp --dport 30001:30011 -j DNAT --to-destination 192.168.168.2 iptables -A FORWARD -d 192.168.168.2 -p tcp --dport 30001:30011 -m state --state ESTABLISH -j ACCEPT iptables -t nat -A POSTROUTING -d 192.168.168.0/30 -j MASQUERADE #iptables -t nat -A POSTROUTING -d 192.168.168.0/30 -j SNAT --to-source 220.127.116.11 sysctl -w net.ipv4.ip_forward=1 iptables -vL