Vpn Reverse Tether Save Abandoned

VPN-based USB "reverse tether"

Project README

VPN-based USB "reverse tether"

Reverse tethering routes traffic from the device via host gateway over USB. This allows the Android device to access the network through the host without depending on Wifi or Bluetooth.

This method leverages VpnService API and does not require root access.

Technical details

+-----------------------+                  +------------------------+
|    Android Device     |                  |       Linux Host       |
|-----------------------|                  |------------------------|
|                       | Android          |                        |
|         ^ iptables    | VpnService       |          ^ iptables    |
|         |             |                  |          |             |
|     +--------+        |                  |      +--------+        |
|     |  tun   |  ---------                |      |  tun   |  ---------
|     +--------+        |  \               |      +--------+        |  \
|         ^             |                  |          ^             |
|         | forward()   | TetherService    |          | forward()   | forwarder
|         v             |                  |          v             |
|    +----------+       |  /               |   +---------------+    |  /
|    | unix sock| ---------                |   | TCP/unix sock | ------
|    +----------+       |                  |   +---------------+    |
|         |             |                  |          |             |
|         |             |                  |          |             |
|     +--------+        |                  |      +--------+        |
|     |  adbd  |        |                  |      |  adb   |        |
|     +--------+        |                  |      +--------+        |
|         +             |                  |          +             |
|         |             |                  |          |             |
+---------|-------------+                  +----------|-------------+
          |                                           |
          |                                           |
          |     adb forward XXX localabstract:YYY     |
          +-------------------------------------------+

Installation

ant

  1. Get Android SDK and NDK. Using the SDK manager, get build tools.

  2. Build the native library:

     $(ANDROID_NDK)/ndk-build
    
  3. Build the apk and install it:

     ANDROID_HOME=$(ANDROID_SDK) ant debug install
    
  4. Build the host-side forwarder:

     make -C jni
    

Eclipse

  1. Get Android Development Tools and Android Native Development Tools.

  2. Import existing project into workspace and build.

  3. Build the host-side forwarder:

     make -C jni
    

Usage

  1. Start the VPN service:

     ./run.sh setup  # You will be asked for sudo password.
    

    Wait for the alert dialog.

  2. Start the tunnel:

     ./run.sh run  # You will be asked for sudo password.
    

    You should see a key icon in the status bar.

  3. When done, press Enter to stop the tether.

License

See LICENSE.

Open Source Agenda is not affiliated with "Vpn Reverse Tether" Project. README Source: google/vpn-reverse-tether
Stars
163
Open Issues
2
Last Commit
7 years ago
License

Open Source Agenda Badge

Open Source Agenda Rating