Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Iptables - Internal/Public forwarding

FlorinMarianFlorinMarian Member, Host Rep
edited August 2018 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 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.

188.212.100.109 - exposed IP address from tunnel
192.168.168.2 - Gameserver IP
192.168.168.1 - internal IP of 188.212.100.109

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 188.212.100.109 -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 188.212.100.109
sysctl -w net.ipv4.ip_forward=1
iptables -vL

Comments

Sign In or Register to comment.