Project

General

Profile

Reverse tethering script

Added by Binh-Khoi Nguyen almost 4 years ago

Hi,

I've just installed Replicant on my phone (thank you to everyone involved by the way!) and am trying to set up reverse tethering.

I'm trying to use the script reverse_tether.sh mentioned in http://redmine.replicant.us/projects/replicant/wiki/ReplicantUSBNetworking

When I execute ./reverse_tether.sh rndis, it hangs at "Starting RNDIS..."

I suspect it's because my HWADDR is incorrect, what should I download?

Can you help me please?


Replies (7)

RE: Reverse tethering script - Added by Binh-Khoi Nguyen almost 4 years ago

Hi,

Actually I managed to still run the script when I use sudo, but then I still don't have internet.

How do I know what value to use for BRIDGE?

I use LAN_DEV=wlp2s0, HOST_DEV=enp0s29f7u2 for the following ip link:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp1s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000
    link/ether 00:15:58:c4:d1:0f brd ff:ff:ff:ff:ff:ff
3: wlp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT group default qlen 1000
    link/ether 00:26:b6:85:39:58 brd ff:ff:ff:ff:ff:ff
5: enp0s29f7u2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN mode DEFAULT group default qlen 1000
    link/ether 9e:01:9c:21:9d:5e brd ff:ff:ff:ff:ff:ff

Is that correct?

RE: Reverse tethering script - Added by Daniel Milewski almost 4 years ago

When I execute ./reverse_tether.sh rndis, it hangs at "Starting RNDIS..."

I guess this is because you run ADB as a unprivileged user. Make sure you run it as the root user:

$ adb kill-server
# adb start-server
$ adb root

RE: Reverse tethering script - Added by Binh-Khoi Nguyen almost 4 years ago

Thanks for your reply!

Now the internet still doesn't work. I get the following output:

Starting RNDIS...
Pinging the phone...
PING 192.168.77.2 (192.168.77.2) 56(84) bytes of data.

--- 192.168.77.2 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms

Can you help me?

RE: Reverse tethering script - Added by Paul Kocialkowski almost 4 years ago

Perhaps you should check that your network configuration software on the host computer (e.g. Network-Manager) doesn't interfere with the script configuring the (usb0) interface. As I recall, this script is not using dhcp. So you could just disconnect the interface in e.g. Network-Managerand run the script again.

RE: Reverse tethering script - Added by F Staub over 2 years ago

I also would like to use the script and did not succeed yet. I came a bit further.

$ adb root
restarting adbd as root
$ ./reverse_tether.sh rndis
Starting RNDIS...
root's password:
Pinging the phone...
PING 192.168.77.2 (192.168.77.2) 56(84) bytes of data.

--- 192.168.77.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 1.758/1.758/1.758/0.000 ms
Success!

I work on openSUSE 42.1 and installed android-tools and bridge-utils

I have to run the next script with sudo:

$ sudo ./reverse_tether.sh nat
Configuring NAT...
net.ipv4.ip_forward = 1
Setting up phone routes and DNS...

Now Android asks to accept the host and I answered yes. After some time this appears:

* daemon not running. starting it now on port 5037 *
cannot bind 'tcp:5037'
ADB server didn't ACK
* failed to start daemon *
error: cannot connect to daemon

I tried to restore the host's networking by using sudo ./reverse_tether.sh stop-all but it does not work and the host must be restarted.

As I understand the "Using reverse_tether.sh" and "Using the Replicant USB Networking scripts" in http://redmine.replicant.us/projects/replicant/wiki/ReplicantUSBNetworking are two distinct options, right?

I tried the second option and failed here:

$ adb push replicant_usb_networking_device.sh /data/
$ adb shell chmod a+x /data/replicant_usb_networking_device.sh
Bad mode

RE: Reverse tethering script - Added by a a almost 2 years ago

I encountered the exact same issue. Has anyone figured it out?

RE: Reverse tethering script - Added by Kurtis Hanna 3 months ago

I just got done testing Wolfgang's reverse tethering scripts, SimpleRT [1], and gnirehtet [2]. All three of them gave me internet connections, but gnirehtet was the only one that worked without any issues or errors. It is the only project that is actively being maintained and I think that we should recommend it to Replicant users instead of recommending SimpleRT or Wolfgang's scripts. I should mention that I've only tested the Rust version of gnirehtet and haven't tested the Java version.

[1] https://github.com/vvviperrr/SimpleRT
[2] https://github.com/Genymobile/gnirehtet

    (1-7/7)