How can I run a game server on a computer behind a NAT, if I have another computer not behind a NAT?

2

  • My home connection is part of a large NAT, outside my control.
  • Inside my home, my router has a NAT, under my control.
  • I control a public facing Linux VPS with one IP address, outside my home network.

Ideally, what I'd like to do is set something up so that I connect my home computer to my VPS, and after that port X on my VPS leads to port Y on my home computer, for the purposes of running a game server of a game that does not run under Linux. Is this possible?

Macha

Posted 2010-12-28T21:05:42.290

Reputation: 4 772

Answers

2

That would only be possible with some proxy software, and a VPN or SSH tunnel. I think you would find the latency and overhead just about impossible to deal with.

Basically, you would SSH to your VPS server in its datacenter, then tell it to forward packets to a certain port through the SSH link to your machine there.

Brian

Posted 2010-12-28T21:05:42.290

Reputation: 2 934

Is there a guide on how to do this anywhere? – Macha – 2011-01-23T21:06:56.697

5

If all traffic to your one IP address comes to your router, it may be possible to direct certain ports to the game server; it really depends on what port forwarding options your router gives you.

If you can get into the router's settings, look for 'port forwarding', 'virtual server' or 'application' configuration options. Better still, tell us the make and model of your router and someone will no doubt be able to advise.

Edited after new comment from op:

You say you control the VPS, so it gets all the traffic sent to your 1 IP address, right? You could use iptables to port forward stuff to a server on your home LAN: http://forum.parallels.com/showthread.php?t=53405. Also do a Web search for vps port forward

Linker3000

Posted 2010-12-28T21:05:42.290

Reputation: 25 670

The IP address and the VPS are off in Linode's data centre. I don't have access to its router, so any forwarding needs to be done on the VPS itself. – Macha – 2010-12-28T21:23:29.430

Here's the problem. External hosts can not access my home LAN directly. Neither can the VPS. I was hoping for something more like the SSH solution suggested by Brian. – Macha – 2011-01-23T21:06:33.890