Skip to main content


How do I setup a "portable proxy" using a Raspberry Pi?


This entry was edited (1 day ago)
in reply to The 8232 Project

Without having too much knowledge in proxys: Especially since NATs are so widespread, I think, you'd need something like tailscale/Nebula/ZeroTier (or simply some Wireguard connection) for this.
This entry was edited (1 day ago)
in reply to Prunebutt

A service like tailscale will solve the connection to your home net automagically. You are however stuck without routing from friend-net so you cant access homenet devices directly

You can solve this by setting up a reverse proxy like caddy on your raspi, and access home-net web-apps and services through that. Like [assigned-friendnet-ipaddress]:8444 or similar.
The reverse proxy would forward this to homenet devices through the tailscale vpn

This entry was edited (1 day ago)
in reply to Prunebutt

Agree on Wireguard. It is faster, more stable and most likely more secured than SSH. And it will work with any application (no per-application configuration required).
Without a third party tunneling service, you will need to expose a port in any case (you can setup port-knocking if you want to).
This entry was edited (10 hours ago)
in reply to The 8232 Project

in reply to IsoKiero

in reply to The 8232 Project

in reply to IsoKiero

So, you want the traffic to go other way around. Traffic from the HomeNet should go to the internet via FriendNet, right?


That is what I would like to achieve, yes. Since I want to avoid setting up port forwarding on FriendNet, I would need to configure port forwarding on HomeNet. The Raspberry Pi would have to act a client, and either the home server or the home computer would act as the server, and the Raspberry Pi would proxy traffic from the server to the internet.

I can't think of how it would work in practice, though. I'm assuming in this case the home server would act as a proxy between the home computer and the Raspberry Pi, and the Raspberry Pi would act as a proxy between the home server and the internet. Unless there's an easier way that would remove the home server entirely, that might be the best way to do it.

in reply to IsoKiero

To me it seems like he wants to be able to «bring along» his homenet services without exposing them on the internet.

Tip for OP is to explain wanted outcome, not process to get there. Its hard to do, but gives better results

in reply to Oisteink

Tip for OP is to explain wanted outcome, not process to get there. Its hard to do, but gives better results


Besides being able to learn about all of this, this would be the ideal outcome:
- Send the Raspberry Pi to a friend who knows about this
- Have the friend plug in the Raspberry Pi to his Ethernet
- Use the friend's network as a VPN/proxy/whatever to obscure my home IP address

I wouldn't want to make the friend set up port forwarding or configure the Raspberry Pi himself, I want to do as much as I can on my own. And, if that friend ever relocates his residence or changes his ISP, setting it up again should be as easy as him plugging in the Raspberry Pi to the new network and I reconfigure it from my end.

This entry was edited (1 day ago)
in reply to The 8232 Project

Then an exit node is what you want. You can set up with vpn like wireguard using port forward on your side. The raspberry would connect using static ip or dynamic dns.

You can get tailscale basic tier for free, and that will provide an easy to use solution

in reply to Oisteink

There is also headscale if you want self-hosted, but its not plug and play like tailscale/zerotier and similar mesh-vpn solutions
in reply to The 8232 Project

Use the friend’s network as a VPN/proxy/whatever to obscure my home IP address


And then your friend is responsible for your actions on the internet. The end goal you described is so vague that at least I wouldn't let your raspberry connect on my network.

There's a ton of VPN services which give you the end result you want without potential liability or other issues for your friend. If you just want to tinker, this thread has quite a bit of information to get you started.

in reply to IsoKiero

I have a feeling OP's "friends" wont necessarily even be aware hes connected the device to their network. It sounds to me like he wants something he can hide places to take advantage of unsecured or public networks without having to sit there with his laptop doing whatever shady shit he has planned.
in reply to The 8232 Project

You're just describing a dozen different things that fit this mold, so let me throw some out there and you can decide what does what you want:

  • SOCKS
  • STUN
  • Haproxy
  • Reverse Proxy

These all do what you want if you're taking the steps to automate pointing to them from whatever your destination endpoint might be. So then you're basically NOT using a VPN, and only a proxy.

Honestly, I'd just install OpenWRT on the Pi and try out different plugins to find what does what you want. You can honestly simplify this all by using Dynamic DNS in the first place to just have a predictable hostname.

This entry was edited (1 day ago)
in reply to Evil_incarnate

I'll let you know if I figure it out! I don't know much about proxies, but I'm still willing to try
in reply to The 8232 Project

@The 8232 Project Feels like an OpenWRT installation running Tailscale could do this unless I massively misunderstand what you’re trying to do.

Selfhosted reshared this.

in reply to Sarah Brown

Yeah, I think tailscale is the way to go. You can also self-host the coordination server if you don't want to use any third party services.
in reply to The 8232 Project

The answer is an SSH reverse tunnel. Have privoxy running in the rPi listening on localhost. Have it then connect to your home server via SSH with reverse tunnels enabled, tunneling the privoxy port. On your home server you run another instance of Privoxy that’s listening in your home network and proxy forwarding over the tunnel and you’re done.

I used to use this setup for pen testing.

in reply to shadejinx

I used to use this setup for pen testing


Used to. Why no longer?

in reply to The 8232 Project

This would be easy with ssh -D 8000 remotehost. I actually do exactly this every day, but not from a Pi, and with a bunch of -L forwards too.

Configure your browser to use 127.0.0.1:8000 as a socks 5 proxy and voila.

Bonus points for having a proxy.pac file with more advanced proxy configuration logic.

Also check out sshuttle.

This entry was edited (1 day ago)
in reply to The 8232 Project

sounds like you want a rpi-zero Ethernet gadget.

I made one years ago that pretended to be an Ethernet adapter as soon as you plugged it into your USB port.

it would boot, connect to WiFi, then connect to VPN, and the laptop it was plugged into would then use that as the primary network source as if it was connected to a lan.

downsides:

  • WiFi sucks and I only saw ~ 250mb connections
  • USB is slow capped at 450mb

but it does work in a pinch.

I think RPI A and B were gadget capable but they dropped support after rpi2 was released.

don't forget you're going to need to setup the proper routing tables and install a DHCP server(maybe...might be able to do static routing but I found it easier to just install dnsmasq).

in reply to The 8232 Project

You will have 2 pieces of the puzle.

  1. Is the proxy, you can use tinyproxy or ssh -D
  2. Is the nat traversal /p2p connection. You can use tor hidden service, tuntox or reverse SSH for that. The first two work when both ends are behind NAT.

You connect using the NAT traversal solution of your choice to the raspberry pi, and you forward proxy port from raspberry to a local port. You configure your browser to use localhost as a proxy.