0

I have a Raspberry Pi 3B+ that I'm using as a Wi-Fi hotspot. I have successfully gotten an access point running on one Wi-Fi USB chip, and using another Wi-Fi USB chip I connected to the public Wi-Fi. My goal here is to setup an SSH Tunnel leaving the Raspberry Pi, and on the Raspberry Pi set a system wide SOCKS proxy as 127.0.0.1, to then proxy all requests entering the Pi's access point over towards my home Wi-Fi. Does this make sense? I am fairly new at this kind of stuff, so any help is appreciated. Thanks!

UPDATE with info from comments:
Not all of my devices on the access point can do ssh/proxying, so I need it to happen between the tunnel and the access point.

I need an SSH tunnel to access resources inside my home network. Yes, they are in fact called wlan0 and wlan1, 0 is for the access point and 1 is for uplink. The endpoint of the tunnel is wlan1 and the other end of the tunnel is a computer on my home network. I am able to connect the tunnel but the proxy is the tricky part.

4
  • I do not understand your application. You have an access point and you have an uplink to your internet router. Why not simply using routing and access of any device to the internet is done? – Ingo Nov 24 '20 at 11:33
  • Not all of my devices on the access point can do ssh/proxying, so I need it to happen between the tunnel and the access point. – Robert Langham Nov 24 '20 at 20:37
  • Why do yo need a ssh tunnel? What are the names of the two WiFi interfaces? Are they called wlan0 and wlan1? Which one is for the uplink and which one is for the access point? Which interface is the endpoint of the tunnel? Where is the other end of the tunnel? Anywere on the internet? – Ingo Nov 24 '20 at 23:59
  • I need an SSH tunnel to access resources inside my home network. Yes, they are in fact called wlan0 and wlan1, 0 is for the access point and 1 is for uplink. The endpoint of the tunnel is wlan1 and the other end of the tunnel is a computer on my home network. I am able to connect the tunnel but the proxy is the tricky part. – Robert Langham Nov 26 '20 at 0:27
2

As far as I understand you have a Raspberry Pi anywhere outside on the internet and want to connect in a secure way to your home network to use its resources. All devices connected to the access point should be able to use the resources on the home network, e.g. webserver, fileserver, database server, printer and so on.

You are using an SSH tunnel which is in principle an end to end connection between distinct devices using source and destination ports. So each device connected to the access point on the RasPi must use an SSH tunnel to the resource on the home network, one tunnel to the webserver, one to the printer and so on. Your idea now is to have a proxy on the RasPi that have made all SSH tunnels to each resource on the home network and will these serve to the devices on the access point, so only the proxy have to made all SSH tunnels and not each device by itself. You asked:

Does this make sense?

It may be conceivable but I haven't seen a solution this way. it does not correspond to the nature of an SSH tunnel. There are better well known solutions to get secure access to remote networks, called Virtual Private Network. You should look for a solution with a VPN. Popular solutions can be found at Wireguard, or OpenVPN, or PiVPN.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.