termux / termux-app

Termux - a terminal emulator application for Android OS extendible by variety of packages.
https://f-droid.org/en/packages/com.termux
Other
36.94k stars 3.88k forks source link

[Bug]: Cannot access the internet when using VPN #4164

Closed lomirus closed 1 month ago

lomirus commented 2 months ago

Problem description

Under normal circumstances, Termux can access the network as expected.

When I launch the VPN, the termux cannot access the internet:

Screenshot_20240923-114720_Termux

To rule out VPN as the problem, here are two pieces of evidence:

  1. All other apps except Termux can access the network normally
  2. Even when I select the Direct Mode in the VPN app settings, termux cannot access the internet either.

In addition, the ping command can receive the response:

Screenshot_20240923-115000_Termux

Steps to reproduce the behavior.

I can always reproduce it on my phone, but don't know how to reproduce it on others users' phones.

My phone uses PixelExperience 13 Plus (Android 13) a week ago. Then I flashed it into crDroid 10 (Android 14), and that's when this problem appeared. I wonder if it's related to the ROM, so I just flashed my phone again into LineageOS 21 (Android 14), but it still reproduced the problem.

What is the expected behavior?

It can access the internet.

System information

sylirre commented 2 months ago

Termux doesn't manage network on its own, so the networking fixes from our side aren't really possible.

As frequent user of NordVPN, ProtonVPN and few other VPN apps, I would say that never had such issue myself. Maybe because I don't use exotic VPN protocols.

Saurabh-codr commented 1 month ago

@lomirus, @sylirre is correct.I also have VPN connected with no issues on termux. So, I think you must diagnose VPN.

lomirus commented 1 month ago

Just solved today by setting export http_proxy=127.0.0.1:7890 manually.