Android Broken eth0 Socket - Replace with USB eth1 - Android Q&A, Help & Troubleshooting

The Android 4.4 device (radxa rock) in question has a broken ethernet socket due to forcing a slightly oversized plug in it.
Im replacement I have a Usb-ethernet dongle connected fairy successfully - using adb I can do stuff like:
netcfg eth0 down
netcfg eth1 up
netcfg eth1 dhcp
setprop dhcp.eth1.dns1 8.8.8.8
netcfg
lo UP127.0.0.1/8 0x00000049 00:00:00:00:00:00
eth0 DOWN 0.0.0.0/0 0x00001002 6e:47:fe:70:62:00
sit0 DOWN 0.0.0.0/0 0x00000080 00:00:00:00:00:00
ip6tnl0 DOWN 0.0.0.0/0 0x00000080 00:00:00:00:00:00
eth1 UP 192.168.1.101/24 0x00001043 00:0e:c6:c3:4b:2d
Click to expand...
Click to collapse
After this I can ping my local network from an adb shell:
ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=5.51 ms
Click to expand...
Click to collapse
But external pings fail.
My question is how can I get the ethernet interface recognised in the Android 4.4 Setup app? What I see there is no IP address or other parameter populated.
Ideally I would like to disable the on-board eth0 hardware.
Thanks

Related

[GUIDE] Reverse USB tethering from Debian GNU Linux to Transformer Prime

This is used when you wish to share a wired ethernet connection from a laptop/desktop to the Transformer Prime via the USB cable.
Ethernet -> Laptop -> USB -> Transformer Prime
All shell commands are issued from your Debian system.
This assume that your ethernet interface is eth1. You can find out this way:
Code:
/sbin/ifconfig -a
On the Transformer Prime activate USB Tethering
Settings > Wireless & Networks > More > Tethering & portable hotspot > USB tethering
On your Debian GNU Linux system:
Code:
su
ifconfig eth1 0.0.0.0
ifconfig usb0 0.0.0.0
brctl addbr br0
brctl addif br0 eth1
brctl addif br0 usb0
ifconfig br0 up
dhclient br0
adb shell netcfg rndis0 dhcp
adb shell netcfg|grep rndis0
The final command should show your rndis0 interface with an IP address. Your Debian system will no longer have an IP for eth1, intead it will use br0
At this pont you should be able to browse the web from the Transformer Prime.
To shut down the bridge:
Code:
su
ifconfig eth1 down
ifconfig usb0 down
ifconfig br0 down
brctl delbr br0
ifconfig eth1 up
dhclient eth1
ifconfig eth1
You may now disable tethering on the Transformer Prime.
Script it
To make this easier you can simply put these commands in a bash script and execute the script.
Code:
# more tetheron
Code:
#!/bin/bash
# Enable reverse USB tethering
ifconfig eth1 0.0.0.0
ifconfig usb0 0.0.0.0
brctl addbr br0
brctl addif br0 eth1
brctl addif br0 usb0
ifconfig br0 up
dhclient br0
adb shell netcfg rndis0 dhcp
adb shell netcfg
Code:
# more tetheroff
Code:
#!/bin/bash
# Disable reverse USB tethering
ifconfig eth1 down
ifconfig usb0 down
ifconfig br0 down
brctl delbr br0
ifconfig eth1 up
dhclient eth1
Know issues:
network-manager in GNOME wants to control the ethernet interface. I found it easiest to disable it.
Code:
service network-manager stop
Note - All of this knowledge is freely available via google although I did not find a specific reference to the Transformer Prime and the rndis0 interface.
Fantastic!
You seem like a great candidate for my question lol
Is there any way we could do this same thing but from another Android device?
I would love nothing more than to be able to use my phone to USB tether to my Prime so that I can avoid using up all my battery broadcasting WiFi.

[Q] MAC Changing in GT-S5302

I want to change the wifi mac address of my GT-S5302. I have tried many apps like Wireless Mac Address Changer but all failed.
Also tried:
Code:
busybox ifconfig //determine device usually eth0
busybox ifconfig eth0 down //shuts down eth0
busybox ifconfig eth0 hw ether 00:00:00:00:00:00 //sets eth0's mac to 00...
busybox ifconfig eth0 up //turn eth0 back on
busybox ifconfig //check to see if eth0 is set to new mac
After changing MAC when i execute "busybox ifconfig" the new mac is reflected but it is not letting me connect to my existing network. I have to restart wifi to get connected but it resets the mac address to the original one.
And also tried editing the ".nvmac.info" , "nvram.txt" ,"nvram_mfg.txt" but all in vain.
Can any one suggest me a working method to change WIFI MAC address for GT-S5302 ?
Thanx in advance :good:
Can anyone please tell me that why I'm disconnected from my existing network after executing these commands?
Code:
busybox ifconfig //determine device usually eth0
busybox ifconfig eth0 down //shuts down eth0
busybox ifconfig eth0 hw ether 00:00:00:00:00:00 //sets eth0's mac to 00...
busybox ifconfig eth0 up //turn eth0 back on
busybox ifconfig //check to see if eth0 is set to new mac

[Q]How to Change Mac address

i used kindle fire HDX 7 with Nexus 2.0.1
other Android device can change MAC address by
using ADB shell with busybox
# ifconfig eth0 |grep HWaddr
# ifconfig wlan0 down
# ifconfig wlan0 hw ether 00:10:11:AB:CD:EF (Which i want to change MAC)
# ifconfig wlan0 up
but i doesn't work. with' SIOCSIFHWADDR : Operation net supported'
and there are no way to change Mac address?

reverse tethering - offline for some applications

I try to get internet on my phone from my computer without installing any tools.
In short when I try a ping to youtube.com it work but the youtube application on the phone
tells me I have no connection.
My configuration looks like :
Code:
mybox -----(Ethernet)------[my computer]------(USB)-----[the phone]
and my phone is in airplane mode to prevent wifi or mobile connections.
I enabled usb tethering so I have two interface on my computer : eth0 and usb0.
Then I have done on the computer:
Code:
sudo ifconfig eth0 0.0.0.0
sudo ifconfig usb0 0.0.0.0
sudo brctl addbr br0
sudo brctl addif br0 eth0
sudo brctl addif br0 usb0
sudo ifconfig br0 up
sudo dhclient br0
and on the phone :
Code:
su
netcfg rndis0 dhcp
After that i have the following configuration :
Code:
IP of rndis0 on the phone : 192.168.1.35/24
IP of br0(eth0 + usb0) on my computer : 192.168.1.17/24
IP of the box : 192.168.1.1/24
If i try to ping the ip adress 8.8.8.8 or any other adresse, it works.
But if I try with a domain it doesn't work :
Code:
[email protected]:/ # ping google.com
ping: unknown host google.com
It look like a DNS problem but i don't understand why because rndis0 give its address from dhcp which also give dns server address.
getprop | grep dns give me
Code:
[dhcp.wlan0.dns1]: [192.168.1.1]
[dhcp.wlan0.dns2]: []
[dhcp.wlan0.dns3]: []
[dhcp.wlan0.dns4]: []
[net.change]: [net.rndis0.dns2]
[net.dns1]: [fe80::8ef8:13ff:fe02:50ea]
[net.dns2]: [192.168.1.1]
[net.rndis0.dns1]: [192.168.1.1]
[net.rndis0.dns2]: []
I know these variables are ignored.
Then I try :
Code:
ndc resolver flushnet rndis0
ndc resolver clearnetdns rndis0
ndc resolver setnetdns rndis0 "" 8.8.8.8 8.8.4.4
and ping google.com now work. I don't understand why the dhcp doens't work...if you can explain.
If I try to connect to any website from google chrome application on my smartphone, it works !
But now when I try to use Youtube application on my smartphone it tell me "No connection".
Do you know why ?

Reverse USB tethering to WiFi hotspot on Nexus 5x with Android Marshmallow

I have a computer connected to the Internet. I'd like to connect my rooted Nexus 5X to it, get internet on my mobile through USB (reverse tethering) and share it wirelessly creating a hotspot. The Nexus 5X is running the stock ROM, Android 6.0.1.
The computer with an Internet connection (let's call it gateway) is correctly configured to share internet to its usb0 interface.
Android is receiving internet (from the USB interface: rndis0) but only the command line applications are able to use it: I can download anything using busybox's wget, but the graphical apps (e.g. Google services - I don't have any other app installed ATM) cannot.
Android is also able to share the connection through its hotspot on wlan0, but it doesn't work properly: the devices connected to my mobile's WiFi (let's call them clients) can resolve hostnames and ping IPs on the Internet (thus ICMP and UDP packets are working), but cannot download anything (TCP connections are broken).
I tried to monitor the traffic on the gateway's usb0 and on a client's wlan0 while trying to download some HTTP data..
On the client's wlan0 I can only see the TCP SYN packets and nothing else, while on the gateway I see many ICPM, DNS (UDP) and ARP packets flying through, but nothing about the HTTP connection. Something unusual that I noticed is that the gateway sees some ICMP "Destination unreachable (Port unreachable)" packets going from android to my DNS server (8.8.8.8).
In order to configure Android to share Internet from rndis0 to wlan0 I did the following:
Code:
# flushing iptables
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
# forwarding (natting) the traffic
iptables -t nat -A POSTROUTING -o rndis0 -j MASQUERADE
iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i wlan0 -o rndis0 -j ACCEPT
I found some threads on the internet suggesting to set the IP address of the 3G interface on the mobile to 0.0.0.0 (this, if I understood correctly, should fool Android's graphical apps into believing there's internet, through 3G), but I couldn't find what interface would be the 3G one... The following interfaces are up (I believe also sit0 was up, but I pulled it down to experiment):
Code:
# # ifconfig | grep '^[^ ]'
dummy0 Link encap:Ethernet HWaddr 02:EF:5A:*CENSORED*
lo Link encap:Local Loopback
rmnet_ipa0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
rndis0 Link encap:Ethernet HWaddr 6A:EE:F8:*CENSORED*
wlan0 Link encap:Ethernet HWaddr 64:BC:0C:*CENSORED*
And the following are all the interfaces
Code:
# ifconfig -a | grep '^[^ ]'
dummy0 Link encap:Ethernet HWaddr 02:EF:5A:*CENSORED*
lo Link encap:Local Loopback
r_rmnet_data0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
r_rmnet_data1 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
r_rmnet_data2 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
r_rmnet_data3 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
r_rmnet_data4 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
r_rmnet_data5 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
r_rmnet_data6 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
r_rmnet_data7 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
r_rmnet_data8 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
rmnet_data0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
rmnet_data1 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
rmnet_data2 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
rmnet_data3 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
rmnet_data4 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
rmnet_data5 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
rmnet_data6 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
rmnet_data7 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
rmnet_ipa0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
rndis0 Link encap:Ethernet HWaddr 6A:EE:F8:*CENSORED*
sit0 Link encap:IPv6-in-IPv4
wlan0 Link encap:Ethernet HWaddr 64:BC:0C:*CENSORED*
No idea what the rmnet interfaces are; I tried to set the IP of rmnet_ipa0 to 0.0.0.0, but it seemed to have no effect...
Any clues?
Did you solve the problem?
I have the same problem. Apps doesn't work, only browser and cli

Categories

Resources