USBNetworking » History » Version 15
Paul Kocialkowski, 02/28/2014 05:16 PM
| 1 | 9 | Paul Kocialkowski | h1. Replicant USB Networking |
|---|---|---|---|
| 2 | |||
| 3 | 15 | Paul Kocialkowski | This page explains how to connect your Replicant device to the Internet via an USB connection to a computer connected to the Internet. |
| 4 | 14 | Paul Kocialkowski | |
| 5 | h2. Using reverse_tether.sh |
||
| 6 | 1 | Paul Kocialkowski | |
| 7 | 15 | Paul Kocialkowski | The @reverse_tether.sh@ script is part of AOSP and can be downloaded from: "reverse_tether.sh":https://raw.github.com/CyanogenMod/android_development/cm-10.1/scripts/reverse_tether.sh |
| 8 | In order to start basic NAT networking between the host and the device, make sure to have installed [[ADB]] and to have the host daemon running as root. Then, use @reverse_tether.sh@ the following way: |
||
| 9 | 1 | Paul Kocialkowski | <pre> |
| 10 | 15 | Paul Kocialkowski | ./reverse_tether.sh rndis |
| 11 | ./reverse_tether.sh nat |
||
| 12 | 1 | Paul Kocialkowski | </pre> |
| 13 | |||
| 14 | 15 | Paul Kocialkowski | h2. Using the Replicant USB Networking scripts |
| 15 | 13 | Denis 'GNUtoo' Carikli | |
| 16 | 15 | Paul Kocialkowski | Replicant USB Networking requires two scripts: |
| 17 | However, you can avoid the host part if your network manager can manage a shared connection. |
||
| 18 | 13 | Denis 'GNUtoo' Carikli | |
| 19 | 15 | Paul Kocialkowski | Make sure to have installed [[ADB]] and to have the host daemon running as root. |
| 20 | 1 | Paul Kocialkowski | |
| 21 | 15 | Paul Kocialkowski | Push the device part on the device and make it executable: |
| 22 | 1 | Paul Kocialkowski | <pre> |
| 23 | 15 | Paul Kocialkowski | adb push replicant_usb_networking_device.sh /data/ |
| 24 | adb shell chmod a+x /data/replicant_usb_networking_device.sh |
||
| 25 | </pre> |
||
| 26 | 1 | Paul Kocialkowski | |
| 27 | 15 | Paul Kocialkowski | h3. Using a network manager shared connection |
| 28 | 1 | Paul Kocialkowski | |
| 29 | 15 | Paul Kocialkowski | 1. On your Linux PC, in the network manager applet (where you normally set up wired or wireless network connections), create a new "Shared" "Wired" connection, with default settings (connection type = Shared). (This is independent of the device, and only needs to be created once.) |
| 30 | 2. Disconnect any other network connections (Wifi, 3G data) on the device. |
||
| 31 | 3. Run the first part of the device-side script: |
||
| 32 | <pre> |
||
| 33 | adb shell /data/replicant_usb_networking_device.sh start1 dhcp |
||
| 34 | 1 | Paul Kocialkowski | </pre> |
| 35 | 15 | Paul Kocialkowski | 4. The device should appear in the host's network manager applet as a new "wired" network connection. Connect this to the "Shared" connection that you created above (it should be in the list of choices given by the applet). |
| 36 | 5. Now run the second part of the script on the device: |
||
| 37 | <pre> |
||
| 38 | adb shell /data/replicant_usb_networking_device.sh start2 dhcp |
||
| 39 | </pre> |
||
| 40 | 12 | Paul Kocialkowski | |
| 41 | 15 | Paul Kocialkowski | The connection should now work. To disconnect the device, run: |
| 42 | 1 | Paul Kocialkowski | <pre> |
| 43 | 15 | Paul Kocialkowski | adb shell /data/replicant_usb_networking_device.sh stop |
| 44 | </pre> |
||
| 45 | 1 | Paul Kocialkowski | |
| 46 | 15 | Paul Kocialkowski | h3. Using the host script |
| 47 | 7 | Paul Kocialkowski | |
| 48 | 15 | Paul Kocialkowski | 1. Disconnect any other network connections (Wifi, 3G data) on the device. |
| 49 | 2. Run the first part of the device-side script: |
||
| 50 | <pre> |
||
| 51 | adb shell /data/replicant_usb_networking_device.sh start1 static |
||
| 52 | 12 | Paul Kocialkowski | </pre> |
| 53 | 15 | Paul Kocialkowski | 3. Wait for the interface to show up |
| 54 | 4. Configure the device interface: |
||
| 55 | <pre> |
||
| 56 | adb shell /data/replicant_usb_networking_device.sh start2 static |
||
| 57 | </pre> |
||
| 58 | 5. Configure the host interface: |
||
| 59 | <pre> |
||
| 60 | sudo ./replicant_usb_networking_host.sh start |
||
| 61 | </pre> |
||
| 62 | 12 | Paul Kocialkowski | |
| 63 | 15 | Paul Kocialkowski | The connection should now work. To disconnect the device, run: |
| 64 | <pre> |
||
| 65 | adb shell /data/replicant_usb_networking_device.sh stop |
||
| 66 | </pre> |
||
| 67 | Cleanup the host: |
||
| 68 | <pre> |
||
| 69 | sudo ./replicant_usb_networking_host.sh stop |
||
| 70 | </pre> |