Trying to set up 4g proxy server with raspberry pi

yamenx

Registered Member
Joined
Oct 15, 2012
Messages
99
Reaction score
2
i'm trying with no success... i try with Squid and with Privoxy and same result... i'm sure i make something wrong...
i have Raspberry pi 4 connected to phone with Hotspot... so i think the problem here cause if i access the ip of the phone with the port i set in the raspberry how he can reach the raspberry pi?
what i miss? and if i got modem stick for the sim card it should work?
 
Hello, im new here, im trying exactly the same but usin raspberry PI4 and this script

https://www.blackhatworld.com/seo/free-guide-create-your-own-4g-mobile-proxy-fully-automated-in-10-seconds-with-1-click.1252694/
Im waiting for USB modem and sim card
 
i have Raspberry pi 4 connected to phone with Hotspot... so i think the problem here cause if i access the ip of the phone with the port i set in the raspberry how he can reach the raspberry pi?

Correct - in your case you have 3 different IP addresses: the public IP the network provides, the private IP that is assigned by the network to multiple phones that share the public IP, and a new private IP that your phone is assigning to the Raspberry PI so many devices can use the phone's hotspot.

You need to use the IP address that your phone is assigning to the RPi, then it should work. Not the IP your phone has assigned by the network. This will only work when connecting to another device that is connected to the same hotspot as the RPi.
 
Correct - in your case you have 3 different IP addresses: the public IP the network provides, the private IP that is assigned by the network to multiple phones that share the public IP, and a new private IP that your phone is assigning to the Raspberry PI so many devices can use the phone's hotspot.

You need to use the IP address that your phone is assigning to the RPi, then it should work. Not the IP your phone has assigned by the network. This will only work when connecting to another device that is connected to the same hotspot as the RPi.

But then i can access that just from the same network...
 
If you don't have router with static IP or dynamic you won't be able to access from outside network.
 
If you don't have router with static IP or dynamic you won't be able to access from outside network.

Nobody on a 4G connection gets a static IP or even a public one assigned, they're NAT'd.
 
It suppose you need a router with a static IP and port forward to 4G ip right?
 
Nobody on a 4G connection gets a static IP or even a public one assigned, they're NAT'd.

i dont care if the ip changes sometimes (i dont think its changed that often in while its active all the time)
 
It suppose you need a router with a static IP and port forward to 4G ip right?
i just have a sim card with 4g... and a software in the laptop with several account that connected to the wifi... so some will use the wifi, and some need to connect with the proxy
 
That's why he needs a connection that has some port open so that he can connect from outside network.
I try before to make all the proxy server in the phone... have no success because can't open ports... now with this i'm back to square 1.... i think the solution not to use phone at all
 
Ngrok is very slow any other service for portforwarding?
 
i'm trying with no success... i try with Squid and with Privoxy and same result...

There is no magic , neither there is plug-n-play. You have to understand Linux Networking , tunnels, routing, firewalls.

Basically here are 2 methods of sharing your phone connection through a raspberry PI:

1. Using your landline connection (broadband, fiber). RPi establishes tunnel to a VPS using broadband connection, binds a port on VPS that is forwarded back to the RPI , where a proxy software is listening (Tinyproxy, Squid, etc). So the proxy software accept requests and forwards it via 4G connection (Wifi or USB tethering).

So the scheme is
Proxy_user>(Internet)>VPS:8888>(tunnel via broadband)>RPI:8888>(Internet 4g)>Website

2. Using only 4g data. It is simpler to get done , but 2x data usage will take place.
Rpi connects to the internet with WIFI or USB tethering, binds the port on the VPS, forwards it back to itself.


So the scheme is
Proxy_user>(Internet)>VPS:8888>(tunnel via 4g )>RPI:8888>(Internet 4g)>Website
 
Back
Top