Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 06-22-2013, 06:33 PM   #1
LQ Newbie
Registered: Mar 2011
Posts: 7

Rep: Reputation: 0
Running Data Through a VPS - how can this be possible?

I don't really know what I'm looking to do. I'm hoping someone out there can translate my layman speak into the actual terms I am looking for so I can start searching Google for instructions.

I want to find a way to run all my data through my VPS so that if I host a game server where people directly connect to my ip address, I can give them my VPS' address and it will route traffic back to me.

This way they connect to that ip address and not to my home address. In fact, by doing this they shouldn't be able to see my ip address at all.

I know how to sort of run an http proxy through the server but that's fine for incomming data but not for hosting a server.

On my home network I have to set myself as the DMZ host or correctly forward the ports required for the game before it will work. I assume I have to do something similar in order for this to work.

Is this possible using something like iptables? Maybe if I use iptables to set up forwarding rules for the incomming ports that the game (or whatever) uses to send it to my home ip address (using the same ports) and then somehow set up my computer so it sends all network traffic back through the VPS, somehow?

This isn't exactly necessary but rather for educational purposes...although it occurs to me that this can be a little bit useful and safer, especially if you play direct ip games with random players on the internet.

Sorry for the convoluted question. I am not knowledgeable to be concise so the best I could be was to try and be comprehensive.

Thank you for your time
Old 06-24-2013, 03:28 PM   #2
Senior Member
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
You are asking to set up a basic forwarding rule for a firewall.

You can use a hardware firewall to do this, or you can use iptables.

So, if your setup is something like: Cable modem -> Iptables firewall -> switch -> your computer

Your iptables firewall would need something like:

iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to
iptables -A FORWARD -d -p tcp --dport 80 -j ACCEPT
to forward port 80 requests to the firewall to your internal computer instead.
Old 03-18-2015, 09:27 PM   #3
LQ Newbie
Registered: Mar 2011
Posts: 7

Original Poster
Rep: Reputation: 0

That isn't quite what I had in mind.

My network path would look like this:

Internet > Remote Virtual Private Server (ie running in Chicago) > iptables? proxy? ??? > Home Modem/Router (ie running in New York) > firewall rules > My Computer

I want to create a proxy between me and the other player. I realize this will increase latency so this isn't something I would use to play a FPS, but there are plenty of other games that this should work fine for. I'm trying to route my traffic through a remote VPS running some flavour of Linux...probably Ubuntu. Maybe Centos or Debian.

Last edited by Aro2220; 03-18-2015 at 09:29 PM.
Old 03-18-2015, 11:09 PM   #4
LQ Newbie
Registered: Mar 2015
Posts: 7

Rep: Reputation: Disabled
a gre tunnel is what you want. i just made a thread about it.

you can give out the remote ip, and all traffic comes to you.
you can send traffic out on the gre interface and it goes out on that ip.
incoming traffic has the correct source ip (not the forwarding server ip).

its very easy to set up as well (on linux)

you can find a nice tutorial on buyvm.nets wiki page

Last edited by mra707; 03-18-2015 at 11:13 PM.
Old 03-19-2015, 02:33 PM   #5
Registered: Mar 2008
Posts: 22,048

Rep: Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632
Just to maybe make a note. A vpn is a way that is supposed to connect computers without others being able to connect to. You might want that.

Since your question asks about ip then you may have to use dynamic dns to make it easier.

But, yes. It may be possible to have others connect to your server on a vpn. They tend to slow down connections unless you have an advanced hardware vpn. A lot of encryption overhead.
Old 03-19-2015, 03:32 PM   #6
LQ Newbie
Registered: Mar 2015
Posts: 7

Rep: Reputation: Disabled
you can also encrypt a gre tunnel using ipsec


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: 9+ Million hits per day on a 512 Mbtyes RAM VPS running Wordpress LXer Syndicated Linux News 0 05-02-2012 10:30 AM
[SOLVED] Is my data safe after running "sync" if I use data=writeback,barrier=0 (ext4)? *Dark Dragon* Linux - General 4 01-11-2012 02:25 PM
How to redirect all traffic from a VPS to another VPS 124748768 Linux - Networking 0 07-08-2011 10:36 AM
OpenVZ and Slackware running on vps astanton Slackware 1 03-08-2011 02:08 AM
Where can I download UML VPS or Xen VPS to make a virtual private server? abefroman Linux - Software 3 12-09-2005 10:00 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:40 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration