VPN equivalent to SSH port forwarding?

1

2

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?

Roger

Posted 2013-09-06T23:53:09.420

Reputation: 121

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 – 2013-09-07T00:11:33.227

the problem with using putty is that it doesn't support udp which is why I'm trying the vpn route. – Roger – 2013-09-07T00:24:07.227

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 – 2013-09-07T03:52:21.880

Was googling fairly randomly and found this that may be to your interest: http://zarb.org/~gc/html/udp-in-ssh-tunneling.html

– Darius – 2013-09-07T13:09:24.880

Answers

1

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.

LawrenceC

Posted 2013-09-06T23:53:09.420

Reputation: 63 487

0

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.

Zoredache

Posted 2013-09-06T23:53:09.420

Reputation: 18 453