LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Does USB tethering bypass VPN? (https://www.linuxquestions.org/questions/linux-networking-3/does-usb-tethering-bypass-vpn-4175734186/)

JASlinux 02-23-2024 09:44 PM

Does USB tethering bypass VPN?
 
Using a PPTP VPN on my Android, when I tether from Linux, the Android is using the VPN while Linux sees my real IP.

I can use Linux VPN & Android tether (VPN is in Linux).

How can a Linux tether get around the Android's VPN?

business_kid 02-24-2024 01:22 PM

You can see what you're doing - we can't. Linux & Android obey rules.; Better restate your question/problem very clearly using diagrams so that nobody can be in any doubt about what is going in and out, and what you want to happen.

Explain how you tested if things work, what happened, and what you want to happen instead.

wpeckham 02-24-2024 01:43 PM

Also, make sure you include your routing tables if possible. We cannot map where the packets should go without some kind of clues, and the routing helps a LOT!

JASlinux 02-24-2024 03:57 PM

This is a curiosity not a project, but it could evolve later.

Somehow the USB tether function (Android 8.1) when paired with Android's builtin VPN, routes around what seems like a serial pathway (A -> C through B, or Linux -> Internet through Android VPN).

Instead I suspect a parallel connection.

jefro 02-24-2024 03:58 PM

wifi on phone?

JASlinux 02-25-2024 03:03 AM

Quote:

Originally Posted by jefro (Post 6485685)
wifi on phone?

Yes, wi-fi & VPN are on the Android.

Open an Android browser & VPN is working.

Open a Linux browser & it sees the Android's local wi-fi connection.

I'm on Ethernet now, but it's so unbelievable I'll have to test it again.

wpeckham 02-25-2024 10:29 AM

You DO realize that the WIFI interface has to be open, working, and detected on the network for it to USE the network to make the VPN connection, right?

A VPN is not magic hardware, it is just an encryption tunnel that encrypts traffic over the network between that host and the VPN endpoint. Anything along the way can even detect the traffic and capture the packets, but they are encrypted so that the contents are difficult to read.

JASlinux 02-26-2024 12:41 PM

Quote:

Originally Posted by wpeckham (Post 6485830)
You DO realize that the WIFI interface has to be open, working, and detected on the network for it to USE the network to make the VPN connection, right?

The VPN is only on the Android. It is physically connected to the Linux machine via USB. Linux wi-fi is not active.

How would you get to a wi-fi router or wireless data network on your Linux machine through an Android with an active VPN?

In Linux I am not seeing the VPN but my real IP.

I know the tether is working (not the computer's wi-fi card) because it's significantly faster when the VPN is off (old hardware).

Like I wrote last post, this needs to be validated with a retest. It's not the most important thing in the world, but I can't believe it. It's not logical that you can get around a VPN when it is the source of your Internet connection.

business_kid 02-26-2024 01:32 PM

Personally, I feel you should go for vpn on both. IP Forwarding with a vpn on is probably more trouble than it's worth. If you're paying for a vpn, they are usually cheap or free about a second box.

And vpn on a mobile isn't the panacea you might think.

JASlinux 02-28-2024 08:46 AM

Quote:

Originally Posted by business_kid (Post 6486100)
Personally, I feel you should go for vpn on both. IP Forwarding with a vpn on is probably more trouble than it's worth. If you're paying for a vpn, they are usually cheap or free about a second box.

And vpn on a mobile isn't the panacea you might think.

Panacea for? I don't know what you mean, but my results are replicated.

I'm in Linux only connected to the Internet via an Android with a VPN on. Linux sees my regular IP while Android uses the VPN.

Guessing now it's something to do with Android's tethering technology.

I could easily put the VPN in Linux as well or independently. This is more a logic exercise. You wouldn't expect tethering to work this way.

jadaja 03-06-2024 04:58 PM

you're using a cable to your phone so naturally the true Ip is going to be seen by the linux machine. you aren't connecting the computer to a hotspot thru your phone. the cable by default bypasses any VPN you could possibly have on the phone. it would possibly/probably do the same if you had a firewall on it as well. you answered your own question when you said that you had the phone USB tethered to the computer. i don't know how a VPN would effect the hotspot if you were using your phone as 1 for the computer.

enigma9o7 03-06-2024 10:18 PM

Quote:

Originally Posted by jadaja (Post 6488071)
you answered your own question when you said that you had the phone USB tethered to the computer.

Pretty sure it's the computer that's USB tethered to the phone. The computer is getting it's network connection from the phone, the phone itself is likely connected to Wifi or mobile data.

I dunno how to share the connection after the VPN thru the cable tho, and I suspect even if he enabled a wifi hotspot on the phone and connected his computer to it thru wifi, it still wouldn't use the VPN.

wpeckham 03-06-2024 11:03 PM

Quote:

Originally Posted by enigma9o7 (Post 6488107)
Pretty sure it's the computer that's USB tethered to the phone. The computer is getting it's network connection from the phone, the phone itself is likely connected to Wifi or mobile data.

I dunno how to share the connection after the VPN thru the cable tho, and I suspect even if he enabled a wifi hotspot on the phone and connected his computer to it thru wifi, it still wouldn't use the VPN.

If it were a Linux phone you could load up some routing software and configure virtual interfaces and make it pipe all traffic for both through a VPN. I cannot say you could not do that under Android, but I have never seen it done.

JASlinux 03-12-2024 09:53 AM

Quote:

Originally Posted by jadaja (Post 6488071)
you're using a cable to your phone so naturally the true Ip is going to be seen by the linux machine. you aren't connecting the computer to a hotspot thru your phone. the cable by default bypasses any VPN you could possibly have on the phone. it would possibly/probably do the same if you had a firewall on it as well. you answered your own question when you said that you had the phone USB tethered to the computer. i don't know how a VPN would effect the hotspot if you were using your phone as 1 for the computer.

I read you are stating a tether automatically produces a bypassed VPN, but not how. It does not seem logical.

Secondarily if I were willing to suffer slower bandwidth, a hotspot connection might still use the VPN. That is a possibility I have not considered.


All times are GMT -5. The time now is 12:27 PM.