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.

Using say: ssh -D8080 user@remoteserver.com

to create an SSH tunnel to a remote server and use it as a SOCKS proxy, etc.,

how would one go about to wrap it into a VPN server (PPTP, L2TP or OpenVPN), if possible, in order to have devices that do not support tunneling but support VPN (like the iPad or DD-WRT routers) be able to log in to the VPN which will then transparently funnel everything through the SSH tunnel?

share|improve this question
I can't quite figure out what you are intending here. You want one device to ssh to a remote server to establish the tunnel, but then accept VPN connections to itself for other devices? –  Paul Nov 29 '11 at 12:43
That's right, and then to funnel all packets from devices connected to it by VPN to the ssh tunnel. I think one way of doing this besides setting up a VPN around the tunnel is to use iptables on a router that forwards everything to the ssh tunnel. Not an expert in this by any means though, just guessing. –  the979kid Nov 29 '11 at 12:52
But the ssh tunnel as described is still a socks proxy, are all the devices internal and you are just trying to get them to the point where the tunnel is? They would still need to have a proxy defined. –  Paul Nov 29 '11 at 12:53
Actually I'm trying to get them to use the tunnel. So for instance, when using Safari on my iPhone it'll access the web through the SOCKS proxy/ssh tunnel setup on my Mac. Is this possible? –  the979kid Nov 29 '11 at 15:19
@flow: Putting a bounty on someone else's question is confusing. Please detail your configuration: The devices involved and their operating systems. –  harrymc Apr 27 '13 at 15:05

1 Answer 1

Going by the comment above, if you have a device that can establish the connection using ssh, and you just want your other internal devices to make use of the proxy it creates, then you can do this:

ssh -D0.0.0.0:8080 user@remoteserver.com

What this does is create the same tunnel with the same proxy, but it opens it to any device that can connect to it. If the machine establishing the connection is internal to your network, then everything else on your network would just use this machine as its proxy server.

If this machine is on the perimeter of your network, with a public facing address, then replace with the internal IP of your network to ensure external parties cannot access the proxy.

share|improve this answer
I've done this, replacing with the IP of the machine connected to the ssh session. On my iPhone I've added it as a manual proxy with the IP of the machine and port 8080. It seems to go through but nothing is loaded, i.e. iPhone Safari shows a blank page. When I kill the ssh session I get a Cannot Open Page on the iPhone, which indicates that there is a connection prior to killing the ssh, but I can't seem to load web pages through it. –  the979kid Nov 29 '11 at 16:47
Can you try it from another Windows PC to see if it is the proxy type that is the issue - it might be that it doesn't support socks. –  Paul Nov 29 '11 at 21:11

Your Answer


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.