Iptables - Internal/Public forwarding
New on LowEndTalk? Please read our 'Community Rules' by clicking on it in the right menu!

Iptables - Internal/Public forwarding

FlorinMarianFlorinMarian Member
edited August 6 in Help

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 (Gameserver internal IP).
I cannot figure why with POSTROUTING commented below all ports give connection time out like there they fly. - exposed IP address from tunnel - Gameserver IP - internal IP of

Hope someone will manage this for me.
Best regards, Florin.
iptables -P INPUT ACCEPT

iptables -F
iptables -F -t nat
iptables -X
iptables -X -t nat

iptables -t nat -A PREROUTING -d -p tcp --dport 30001:30011 -j DNAT --to-destination
iptables -A FORWARD -d -p tcp --dport 30001:30011 -m state --state ESTABLISH -j ACCEPT
iptables -t nat -A POSTROUTING -d -j MASQUERADE
#iptables -t nat -A POSTROUTING -d -j SNAT --to-source
sysctl -w net.ipv4.ip_forward=1
iptables -vL


Sign In or Register to comment.