Author Topic: pair your public-facing server with your home server (or, tunneling ftw)  (Read 793 times)

Pinako

  • Hero Member
  • *****
  • Posts: 1263
    • View Profile
    • inportb
Clearly, this is no way to run a production service, but sometimes it's useful during development to run some services off-site where you have more opportunities to control and monitor application behavior. In my case, I simply did not have enough resources on my VPS to host my database, but I wanted to test things before upgrading. There was just one tiny snag: my home server is behind a NAT that I don't have any control over, and my VPS does not support IPv6 for NAT traversal purposes. What now?

The problem boils down to this: my database runs at home:5984, I want it to be available at vps, but home is behind a NAT. The most notable solutions are:
  • use a VPN
  • use a SSH tunnel

SSH is easiest for mapping a single service, and I'd encourage you to look into reverse-tunneling if it fits your use case. A single command from home does the trick for me:
ssh inportb@vps -R5984:localhost:5984

Also, here's the requisite screenshot as I index all my data...


Incidentally, the reason I can't use a VPN is the same reason I couldn't use IPv6: no tun/tap support in my VPS. There is clearly a performance issue preventing this from being a production-quality solution: the 3Mbps pipe between the two servers really can't compete against a local/loopback connection.
« Last Edit: November 05, 2010, 07:07:04 PM by inportb »

zzbomb

  • Hero Member
  • *****
  • Posts: 963
  • The awesome server admin
    • View Profile
    • ChemicalServers
Re: pair your public-facing server with your home server (or, tunneling ftw)
« Reply #1 on: November 06, 2010, 05:00:25 PM »
Heh. Fun. Did you ever try doing it via ipv6?

Pinako

  • Hero Member
  • *****
  • Posts: 1263
    • View Profile
    • inportb
Re: pair your public-facing server with your home server (or, tunneling ftw)
« Reply #2 on: November 06, 2010, 07:15:32 PM »
Yes; it doesn't work because the VPS doesn't do TUN/TAP. On the other hand, using IPv6 for NAT traversal does not perform very well at all, so I preferred the reverse tunnel.

zzbomb

  • Hero Member
  • *****
  • Posts: 963
  • The awesome server admin
    • View Profile
    • ChemicalServers
Re: pair your public-facing server with your home server (or, tunneling ftw)
« Reply #3 on: November 07, 2010, 08:52:38 AM »
Yes; it doesn't work because the VPS doesn't do TUN/TAP. On the other hand, using IPv6 for NAT traversal does not perform very well at all, so I preferred the reverse tunnel.
Lol ok. Too bad theres not native ipv6 support.  :-\

Pinako

  • Hero Member
  • *****
  • Posts: 1263
    • View Profile
    • inportb
Re: pair your public-facing server with your home server (or, tunneling ftw)
« Reply #4 on: November 07, 2010, 09:01:55 AM »
I forgot to mention that SSH is also a little bit more secure ;)