DeprecatedReplicant60USBNetworking » History » Version 1
Wolfgang Wiedmeyer, 03/06/2017 10:30 PM
original version
1 | 1 | Wolfgang Wiedmeyer | h1. Replicant USB Networking |
---|---|---|---|
2 | |||
3 | This page explains how to connect your Replicant device to the Internet via an USB connection to a computer connected to the Internet. |
||
4 | |||
5 | h2. Using reverse_tether.sh |
||
6 | |||
7 | 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 | <pre> |
||
10 | ./reverse_tether.sh rndis |
||
11 | ./reverse_tether.sh nat |
||
12 | </pre> |
||
13 | |||
14 | h2. Using the Replicant USB Networking scripts |
||
15 | |||
16 | Replicant USB Networking requires two scripts: attachment:replicant_usb_networking_device.sh attachment:replicant_usb_networking_host.sh |
||
17 | However, you can avoid the host part if your network manager can manage a shared connection. |
||
18 | |||
19 | Make sure to have installed [[ADB]] and to have the host daemon running as root. |
||
20 | |||
21 | Push the device part on the device and make it executable: |
||
22 | <pre> |
||
23 | adb push replicant_usb_networking_device.sh /data/ |
||
24 | adb shell chmod a+x /data/replicant_usb_networking_device.sh |
||
25 | </pre> |
||
26 | |||
27 | h3. Using a network manager shared connection |
||
28 | |||
29 | 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 | </pre> |
||
35 | 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 | |||
41 | The connection should now work. To disconnect the device, run: |
||
42 | <pre> |
||
43 | adb shell /data/replicant_usb_networking_device.sh stop |
||
44 | </pre> |
||
45 | |||
46 | h3. Using the host script |
||
47 | |||
48 | 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 | </pre> |
||
53 | 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 | |||
63 | 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> |