Skip to content

Instantly share code, notes, and snippets.

@gcoda
Created November 29, 2014 09:13
Show Gist options
  • Save gcoda/7e7444aa6bf339079c58 to your computer and use it in GitHub Desktop.
Save gcoda/7e7444aa6bf339079c58 to your computer and use it in GitHub Desktop.
How i migrated my TS3 server to new host
# i run this on my current TS3 server to redirect connections on new host
# --to might be changed to --to-destination
# %%DESRINATION.IP%% is ip address of my new VDS
iptables -t nat -A PREROUTING -p tcp --dport 9987 -j DNAT --to %%DESRINATION.IP%%:9987
iptables -A FORWARD -d %%DESRINATION.IP%% -p tcp --dport 9987 -j ACCEPT
# and for UDP, not sure if TCP port even matter for TS3
iptables -t nat -A PREROUTING -p udp --dport 9987 -j DNAT --to %%DESRINATION.IP%%:9987
iptables -A FORWARD -d %%DESRINATION.IP%% -p udp --dport 9987 -j ACCEPT
iptables -t nat -A POSTROUTING -j MASQUERADE
sysctl net.ipv4.ip_forward=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment