Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My friends have a Mine craft server with an ip to connect ( This is obviously not ideal as a true domain name would be more user friendly.

Although I share a VPS with a friend who has a domain name and we even have a site for our server.

Is it possible to have traffic sent to our VPS on port 25565 (mine craft default port) and have the VPS redirect the traffic to our servers IP?

Would a connection like this have to go through the VPS everytime or only when the player connects? I don't want my friends VPS to get slowed down because of this.

Thanks for the help.

share|improve this question
up vote 4 down vote accepted

Yes: there are two ways to do this.

One is to use something like redir(1), which should be available on most Linux distributions, and which makes a second TCP connection, relaying data between the two.

The other is to use the firewall on the system to do the redirection. You need to rewrite the destination, to your minecraft server, and the source, to your VPS, so that packets come back through the VPS. (eg: identical to the other, but with the kernel and NAT rather than a normal process forwarding the data.)

A better solution might be to add a subdomain,, to the domain that serves the VPS. That can point to the target server directly, and people can connect to it.

That has none of the drawbacks, notably latency, that bouncing through the server has, and still gives you a nice name.

share|improve this answer
Excellant! I think I will use the firewall method. Thanks a ton. – A Clockwork Orange Jan 29 '12 at 20:10
Be absolutely certain that packets get NAT on the source as well as the destination: you need the response from the server to come back through your VPS. That doesn't happen without explicit configuration. – Daniel Pittman Jan 29 '12 at 20:14

iptables is a solution.
I prefer this one: socat TCP-LISTEN:25571,fork

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.