the iranian government has been extreme with internet restrictions recently. a lot of linux package managers dont even work unless you have a VPN. apps and repositories just dont install properly . so i basically cant set up my raspberry pi because installing apps is not possible over the network. naturally i cant install VPN programs either . but my main PC does have a VPN and i can connect to proxies on my PI so i was hoping there is a way to make my lap top a local proxy server for other devices so they can use my VPN connection . i know its possible on android devices so it should be doable on A linux PC
Go for a VPN router, dd-wrt would be a cheap option
Is your “main pc” the laptop you mention? Is that Linux already?
my router is not supported sadly
I wad actually going to suggest a VPN on a router like the other person who commented.
If money is tight and time is plentiful, you could learn a thing or two and even setup a normal PC as a linux router and route all LAN traffic through a VPN and back. It doesnt even need to be a strong PC, a 4 core Atom processor can route symmetric gigabit over a wireguard VPN, so any cheap old PC will do really especially if you have a weaker WAN connection.
All youd want is a PC with two network interfaces, ideally ethernet but not necessarily required to be so, you could hypothetically pull WAN on ethernet and setup an access point using a wireless network interface card if your card supports that if you couldnt find a second wired network interface card for the PC.
for what its worth my main router has 4 ethernet ports and my lap top can create hot spots with the wifi card . i did the vpn sharing thing before but on windows.
It doesn’t even need to be a dedicated PC; I used to run pfSense in a VM (virtualbox) on my daily driver computer - I guess you can even use a docker as a simpler solution.
Of course, two physical (eth) interfaces are still needed…
Then you could install squid on there, and use it as a http proxy on your PI.
You have a few options, probably:
- Set up squid and tell your other machines (via proxy settings) to use the squid server as a proxy.
- Turn your linux machine into a router. Which would allow all traffic. You probably don’t need this, and it’s more things to make work. (ip forwarding, and dhcp, etc).
- Set up a vpn on your linux box for your other machines to connect to. When they’re connected to that, they’ll be using your linux machine’s default gw, which would be the vpn when it’s connected to the vpn, or straight to the internet when it’s not connected. I would suggest looking at SoftEther VPN.
SoftEther supports multiple protocols and uses udp traversal, w/o a 3rd party, to allow connections to your VPN from the internet. It also has a GUI configuration tool. Unfortunately the GUI config tool is Windows only, but fortunately it runs fine on WINE.
Okay, so to do this in linux, there are a couple of ways. you could create what is knows as an ad-hoc network on your wireless card from your laptop, enable routing, make yourself default gateway, and set up firewall rules to route all traffic from that network over your VPN. You could theoretically also do that backwards using wifi to connect to your router and ethernet to tether to your clients, all else the same.
If all of this just sounds like a pain, you can just download network drivers on the laptop for the rpi, install then on the rpi and after that get connected to the VPN on the rpi
Youre not wrong, that would work, that just feels cumbersome since youd knock the network down if you needed to restart your PC. Plus it feels overengineered for the current issue if he could just drop an old optiplex in to fill the gap.
i might try the squid first. then the 3ird option