View Single Post
Old 03-12-2010, 01:30 AM   #2
Newworlds
Legend
 
Join Date: Aug 2007
Name: NewWorlds
Home MUD: New Worlds
Posts: 1,425
Newworlds will become famous soon enoughNewworlds will become famous soon enough
Re: Easiest way to point alternate ports to the same port.

My best advice is to do what we do at NWA (if you don't already) and setup a secondary instance of your game on another port, say port 5023. You will do this in order to test out this setup prior to knocking down the live version of Threshold (although, theoretically this should work without taking down the game at all).

After you got your backup (secondary) game running, then try this assuming the port your want to redirect is 5000 to port 5023:

iptables -A INPUT -i eth0 -p tcp --dport 5000 -j ACCEPT
iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 5000 -j REDIRECT --to-port 5023

Then try connecting via port 5000 and see if it redirects and connects to port 5023.

If this works just change this to the following:

iptables -A INPUT -i eth0 -p tcp --dport 5000 -j ACCEPT
iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 5000 -j REDIRECT --to-port 23

And wallah! Anyone porting to 5000 (or any other port you choose) should redirect to your live game on 23.

Remember you are dealing with iptables so be judicious and careful. These instructions assume you have full root access and administration rights of your server. Might even want to play around with these commands on a secondary homebase linux box with Redhat or similar system running to ensure proper operation.

Good Luck!
Newworlds is offline   Reply With Quote