Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have an application on my remote server, it can only be accessed through localhost:3000 (not accessible from internet)

When I SSH into my remote server using putty with a tunnel L"*:3000" localhost:3000 and the local ports accept connections from other hosts box checked, I can access the application by going to http://127.0.0.1:3000 on my local machine. I can further access the application by going to http://192.168.0.9:3000 (my local machines internal network address) on a tablet connected to the same wifi.

I have setup OpenVPN on the remote server and I can access the application by going to http://10.8.0.1:3000 however I need to be able to access it from another device on my local network (the tablet). How would I route 127.0.0.1 to 10.8.0.1 so that I can access the application from my tablet by going to http://192.168.0.9:3000 like I could do when using putty?

share|improve this question
    
Since you want the tablet to access the local PC (192.168.0.9:3000) but in actuality it connects to the remote server (10.8.0.1) you can set up putty with the same forwarding. So on the local PC, you set up putty with Source Port 3000, Destination 10.8.0.1:3000 - this will allow anything connecting to 192.168.0.9:3000 forward the connection to 10.8.0.1:3000. Hope this helps. –  Darius Sep 7 '13 at 0:11
    
the problem with using putty is that it doesn't support udp which is why I'm trying the vpn route. –  Roger Sep 7 '13 at 0:24
    
Another possibility since you mentioned VPN, you can VPN your whole connection (VPN connects from your local modem to the remote host) therefore all connection are VPN through to your remote host, not just your local PC. –  Darius Sep 7 '13 at 3:52
    
Was googling fairly randomly and found this that may be to your interest: zarb.org/~gc/html/udp-in-ssh-tunneling.html –  Darius Sep 7 '13 at 13:09

2 Answers 2

up vote 1 down vote accepted

If it's an Android tablet, and running at least ICS, install OpenVPN on it through Google Play. I haven't tried it but this looks like an OpenVPN client for the iPad. If it's a Surface RT, try installing and configuring pptp on your server and see if you can connect via a PPTP VPN on the Surface (not sure if it supports that).

Otherwise, you will need to proxy to it. This means setting up the VPN connection on your PC, and running a program on your PC that listens on a socket (IP + port) on your local network, and forwards UDP to an socket on the VPN. I think you can use sudppipe for that purpose. You'll then enter the local IP of your PC and the UDP port for whatever you are doing on the tablet.

share|improve this answer
    
sudppipe did it, thanks. –  Roger Sep 7 '13 at 22:03

If you establish a VPN connection, and you have setup networking properly, you will access the system as if you were on the local network. You shouldn't need port forwarding, or proxies at all. A VPN should make the VPN endpoint act as if it was on the remote network.

If it isn't working like that, then your VPN might be setup wrong. Getting the routing correct can be a bit tricky.

share|improve this answer

Your Answer

 
discard

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.