My friends have a Mine craft server with an ip to connect (206.217.128.131:25571). 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.

link|improve this question
feedback

2 Answers

up vote 3 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, minecraft.example.com, 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.

link|improve this answer
Excellant! I think I will use the firewall method. Thanks a ton. – A Clockwork Orange Jan 29 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 at 20:14
feedback

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

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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