I have been attempting to get reverse tethering working on my phone. I have a Galaxy S5 (g900t), running cyanogenmod 13 (marshmallow)...rooted, and with busybox.
*Edit: I've made some progress. I ran this on my ubuntu machine:
sudo ip addr flush dev eth0
sudo ip addr flush dev usb0
sudo brctl addbr br0
sudo brctl addif br0 eth0 usb0
sudo ip link set dev br0 up
sudo dhclient br0
And then I ran this in the adb shell:
dhcptool rndis0
After doing this, I seem to have internet.
I can do wget -s google.com
. However, it only works as su
.
root@klte:/ # wget -s google.com
Connecting to google.com (4.59.40.99:80)
Connecting to www.google.com (4.59.40.99:80)
2000@klte:/ $ wget -s google.com
wget: bad address 'google.com'
I verified that I can do wget
as a regular user when I am connected through cell network or wifi.
So my question is:
Why would I be able to apparently access the internet as su
, but not as a regular user? I've checked my ifconfig
and route
settings, and they all look the same either as su
or regular user. Does anyone see what I'm doing wrong?
Config setting printouts
These settings are all the same, whether I run them as su
or not. Here is my ifconfig
:
1|root@klte:/ # ifconfig rndis0
rndis0 Link encap:Ethernet HWaddr 62:91:0C:85:FD:6B
inet addr:192.168.22.6 Bcast:192.168.22.255 Mask:255.255.255.0
inet6 addr: fe80::6091:cff:fe85:fd6b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:582 errors:0 dropped:0 overruns:0 frame:0
TX packets:126 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:62495 (61.0 KiB) TX bytes:15839 (15.4 KiB)
And here is my route
table:
root@klte:/ # route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.22.1 0.0.0.0 UG 0 0 0 rndis0
192.168.22.0 * 255.255.255.0 U 0 0 0 rndis0
And it appears that my DNS servers are set correctly:
root@klte:/ # cat /etc/resolv.conf
nameserver 8.8.4.4
nameserver 8.8.8.8
Answer
I just recently stumbled across what seems to me to be a much better (or at least easier) solution for reverse tethering: gnirehtet
It sets up a VPN on the android which redirects all traffic across an adb reverse
port connection. Doesn't even require root at all.
No comments:
Post a Comment