One line version: enable adb debugging on device, ensure you have a recent version (>= 29) of
adb on computer, download and execute
There are cases where you may want to have your phone get Internet connectivity through your computer. This is called reverse tethering.
(Tethering is when doing the opposite, giving your computer Internet access via your phone)
This may be done because you are travelling, and have no data allowance when out of your country, but your laptop happens to have Internet access (either over Wifi or Ethernet). Or, in a further scenario, because a hotel might charge per extra device connected to Wifi, and with reverse tethering you only need to connect one device.
It may also be done so you can inspect the trafic coming out of the phone, using standard linux tools such as tcpdump or wireshark.
A further advantage is that if your computer is connected to your home network via a VPN, your phone also gets access to anything in that network
In truth, reverse tethering is not something that is useful on a regular basis, but it is a nice tool to have. Also, if you are one of those people that enjoys learning semi-useful networking tricks, it’s fun.
With all this being said, let’s see how to make it work.
It turns out, with the right tool, it’s surprisingly simple.
Step 1: Android
You need to have Android debugging enabled. If that’s already the case, skip to step 2, otherwise read on.
If you haven’t already, activate the developer options (go to “Settings > About phone” or “Settings > System > About phone” or “Settings > About phone > Software information” and tap multiple (8) times on “Build number”).
Then go the developer options (in “Settings > System > Advanced” on the device i’m using) and under “Debugging” toggle “Android debugging” to on.
That’s all for now.
Step 2: computer
gnirehtet (tethering backwards, very clever) and a recent version of
adb, the Android Debug Bridge (from Android Platform Tools v29 or above, from what i can tell).
As Android tools aren’t always as up to date as we’d like in distribution repos, you are likely to have to download them from the Android website.
Extract the package to a directory and add that directory to your PATH, in order for that version of
adb to be used. To do so, from within directory you extracted the
which adb should confirm you are using the right version (not the system version).
Download gnirehtet on its Github page.
Unzip the file, you can then execute it with
More specifically, to set up your system to tether a single phone (which is what we are going for):
Step 3: Android
You should now see a request to accept adb connections from the computer if it’s the first time
adb is used to connect to the device from this computer. Accept, and you should then see a message telling you gnirehtet wants to setup a VPN connection.
Traffic should now be going through the “VPN” and through the computer.
Quoting the gnirehtet documentation:
you can enable reverse tethering for all connected devices (present and future) by calling: