LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Proxied wifi hotspot in linux lab experiment. (https://www.linuxquestions.org/questions/linux-networking-3/proxied-wifi-hotspot-in-linux-lab-experiment-4175702447/)

axolinx 10-22-2021 04:17 AM

Proxied wifi hotspot in linux lab experiment.
 
Hello networking guys.

My situation:
I am currently traveling overseas and im having isues managing some of my finantial apps and a few others installed on my cellphone that i need to use, from being connected with ISPs out of the country.

My devices:
1. My cellphone
2. My laptop with Linux Mint
3. My Ubuntu server in the US, running in my home.

On my laptop computer, i am able to connect to the US with a third party VPN server (ISP restrictions here are blocking straight VPN connections to my router at home and a few other locations i previously set up).

Once i am connected to the VPN, i SSH into my server with the dinamic port option, for example: ssh -D 9999 user@207.001.222.333
once i establish the connection, i am manually setting up firefox to use local proxy 127.0.0.1 on port 9999. So the result is a web browser window with my local IP at home, and i am able to do anything as if i am sitting in my room's desk in US.

Now, i tried a few proxy apps on my cellphone, but they do not work or trick the apps to use the connection at home. I can open the same SSH tunnel using the termux app, and tried setting the proxy in the android settings but still no go.

Now i would like to try, setting up a wifi hotspot from my laptop, so i can connect to it with my cellphone. And the wifi hotspot should of course be tunneled with the SSH proxy i mentioned above.

I do have an extra USB wifi dongle, that can be setup in monitor mode just in case it is needed, but my skills end here, please let me know if what i am trying to accomplish is possible, and any tips to get there.
Thank you!

UPDATE:

Ok i figured creating the wifi hotspot on the laptop is pretty easy with the GUI tools.
1. Now my computer is connected to a router with Ethernet
2. I am connected to the VPN
3. I opened the SSH tunnel with the dinamic port
4. The wifi card is setup as a hotspot
5. My phone is connected to the wifi hotspot in the laptop, and i get the IP address from the VPN connection

Here is a screenshot with the setup. There is a tab with "proxy" options for the wifi hotspot, but no way to set the loopback address and port number im using with the ssh connection.


https://i.imgur.com/LmFktZX.png

There is another section in the network manager where i am able to setup the proxy, but then the connections stop working in the laptop:

https://i.imgur.com/o6CIaUj.png

UPDATE2:

I found sshuttle
so now i can run: sshuttle -r axo@207.111.222.333 0/0
the laptop tunnels the traffic from my brave browser for example to my home IP in the US.. this is cool, no more manual setting needed in firefox (brave does not let you setup a manual proxy)

BUT.... the wifi hotspot still routes via the VPN ip, not using the SSH tunnel .. i am just missing that connection.
Let me know if you have any ideas.. thank you

Turbocapitalist 10-22-2021 06:48 AM

You can attach the images to your post so that they are together and readable.

Just taking a quick look at the manual page for sshuttle and it looks like you can do the same thing with the standard SSH client and the -D option. If you don't want to adjust the Proxy option in your web browser to point to the SSH client's SOCKS5 proxy, then you can launch the browser with proxychains instead.

axolinx 10-22-2021 06:55 AM

Quote:

Originally Posted by Turbocapitalist (Post 6294656)
You can attach the images to your post so that they are together and readable.

Just taking a quick look at the manual page for sshuttle and it looks like you can do the same thing with the standard SSH client and the -D option. If you don't want to adjust the Proxy option in your web browser to point to the SSH client's SOCKS5 proxy, then you can launch the browser with proxychains instead.

Thank you..

The main point of all this is to make my cellphone go through the proxy, not the computer.
as i mentioned above, i can setup a manual proxy on the phone / used different apps to force it and this did not work.
The tunnel needs to be already in the wifi hotspot i create and THEN the phone will have no option, but to go through that route.

Thank you

timertim 01-14-2024 06:04 PM

Did you ever figure this out
 
Hey, did you figure this out in the end ?


All times are GMT -5. The time now is 03:14 PM.