i.e. to access a PC's internet connection from the phone for data via USB (NOT use phone's 3G connection!)
My problems;
3G Data from my provider costs $269 a GB!
My PC has wireless internet but through a USB modem, not a router.
Cannot share the connection with a WiFi router as routers (or mine anyway) don't have a USB connection, ie I can't plug the USB modem into my router.
I can share data through a wireless dongle but only via ad-hoc network, but I can't seem connect my Dream to ad-hoc networks and am not even sure that it will be able to share the internet once connected. I've tried various Wifi tether applications.
So a USB tether app would be perfect. Else how can I use my PC's internet connection for data on the phone?
HTC Dream rooted and running CM4.2.8
Correction in title, YOU need a reverse teether.
WIFI is not hard to comeby, comeon.
The Dream can connect to ad-hoc networks, but ask that in Q&A.
No, I'm not the only one, this is a question that has been asked quite a few times before.
Also having read through many posts I have found no reference to anyone that has actually successfully shared the PC's internet connection to the phone with an ad-hoc network.
Wait a sec, you said that you have a WiFi router? A separate device from the USB modem?
1. Connect the router to your PC via Cat 5
2. Set up routing on your computer (ICS if you are running windows)
3. Set up the wireless part of the router
4. Connect the Phone to the router WiFi.
5. Use the WiFi normally from your phone.
This might help until someone can get reverse WiFi or USB tethering to work.
t1n0m3n said:
Wait a sec, you said that you have a WiFi router? A separate device from the USB modem?
1. Connect the router to your PC via Cat 5
2. Set up routing on your computer (ICS if you are running windows)
3. Set up the wireless part of the router
4. Connect the Phone to the router WiFi.
5. Use the WiFi normally from your phone.
This might help until someone can get reverse WiFi or USB tethering to work.
Click to expand...
Click to collapse
Look carefully to the topic. It has written USB not wireless.
kiiiiiid said:
Look carefully to the topic. It has written USB not wireless.
Click to expand...
Click to collapse
That would be why it is called a work around. The suggestion is a response to this statement "Else how can I use my PC's internet connection for data on the phone?" from the OP.
pardus said:
No, I'm not the only one, this is a question that has been asked quite a few times before.
Also having read through many posts I have found no reference to anyone that has actually successfully shared the PC's internet connection to the phone with an ad-hoc network.
Click to expand...
Click to collapse
I've shared internet with G1 via ad-hoc without problem. The solution I found in Q&A section
1. Get a Wireless router
2. Plug ethernet cable from PC to Internet Input on Router
3. In Windows control panel, edit the wireless connections settings to shared
4. Connect to the router and setup wireless network settings
5. Connect to wireless network with phone
There you have it, easy steps to do what you need.
After hours of 'googling', it seems that's it's impossible to get my router to share a USB modem's connection (http://forum1.netgear.com/showpost.php?p=68070&postcount=5)
@g1DDriver: Please show me where, I've searched but can't find it?
@Wisefire: 2. Plug ethernet cable from PC to Internet Input on Router - if I do that I cannot connect to the router at all, ipconfig shows the ip address as 192.168.1.2 but a browser just doesn't see it.
just buy a wireless router. they cost what, like 10$ now while on sale?
kb8to24 said:
just buy a wireless router. they cost what, like 10$ now while on sale?
Click to expand...
Click to collapse
could also try this
http://www.readwriteweb.com/archives/watch_out_wifi_here_comes_mifi.php
kb8to24 said:
just buy a wireless router. they cost what, like 10$ now while on sale?
Click to expand...
Click to collapse
perhaps you're not reading my first post correctly, I have a wireless router...
...and anyway is it even possible to plug a USB modem into a router, it would need drivers & software which the the router can't handle?
My ISP also has their own proprietary modems (http://www.iburst.co.za/default.aspx?link=hardware_modems) which are very pricey, so I'm not getting another modem either.
I've been trying to set-up an ad-hoc network using the instructions here: http://blog.joint.net/2009/07/connecting-android-phone-through-adhoc.html
but having no luck.
Who'd of thought something so painlessly simple in WM6 would be a nightmare in Android
pardus said:
My ISP also has their own proprietary modems (http://www.iburst.co.za/default.aspx?link=hardware_modems) which are very pricey, so I'm not getting another modem either.
Click to expand...
Click to collapse
From that link, which modem do you have. A model # would be nicer.
Also, what is the model # of your router?
What OS are you using?
pardus said:
@Wisefire: 2. Plug ethernet cable from PC to Internet Input on Router - if I do that I cannot connect to the router at all, ipconfig shows the ip address as 192.168.1.2 but a browser just doesn't see it.
Click to expand...
Click to collapse
That would be because you are trying to manage the router from the WAN port... If you want to be able to do this you need to enable remote management. (Connect PC to inside, enable remote management, the connect to outside (WAN port) and use the http:// 192.168.1.1:8080 or whatever you set the port RM to)
The modem I have is "USB Modem for laptops and desktops"
Router is the Netgear WGR614v7 and OS is Win XP
I see a couple of things that could have prevented you from making this work.
By default the Netgear router gives 192.168.1.0 (mask of 255.255.255.0) to the inside. You cannot use the same network between the computer and the router. I would change the network on the inside of the router to 192.168.5.1 255.255.255.0. (Just change the 1 to a 5 in the router settings.)
ftp://downloads.netgear.com/files/wgr614v7_ref_manual_20apr06.pdf
So connect your PC to one of the four ports. Let it get an IP address. Connect to http://www.routerlogin.net (Per the instructions in the PDF.) Login and change the inside address pool to 192.168.5.1 255.255.255.0. (Instructions are at Chapter 6, "Using the LAN IP Setup Options" in the PDF above.) Reboot the router.
Connect to http://www.routerlogin.net again. Login and enable remote management. (Instructions are Chapter 6, "Enabling Remote Management Access" in the PDF above)
Enable Internet Connection Sharing on your computer.
Reboot the router again.
Once the router connects again, open a command prompt and do a "arp -a" (without the quotes) and get the IP address of the router. (It will be the IP address in the 192.168.1.x range that is *not* listed in an ipconfig from the command prompt)
Connect to that IP address (for example http://192.168.1.6:8080) and continue on setting up the wireless part normally.
Once you connect your phone to WiFi the connection flow looks something like this:
Phone = 192.168.5.21 > NAT > 192.168.1.6 <routed> 192.168.1.1 (IP of your Wired NIC on the computer) > NAT > USB NIC IP address > Internet
Of course the IP addresses above are just guesses as to what you will actually see.
Hopefully this will get you going well enough until someone gets reverse tethering to work.
Reverse tether g1 to pc network over usb cable
My android os is CyanogenMod 4.2.14.1,
1.Enable "Settings\Wireless controls\Internet tethering"
2.Install HTC Remote NDIS based Device driver(View attachment 277122)
3.Set the HTC adapter as: IP:192.168.2.1, Mask:255.255.255.0
4.Set the PC ethercard as shared connection
5.Run these codes in terminal:
su
ifconfig usb0 192.168.2.2 netmask 255.255.255.0
busybox route delete default
iptables -F
iptables -F -t nat
busybox route add default gw 192.168.2.1
setprop net.dns1 8.8.8.8
setprop "net.gprs.http-proxy" ""
6.Now your g1 could open browser to view any web pages on the internet, and update apps in the Market.
for diyism
hello everyone!
I was trying to find a way to connect my iconia via usb with my laptop and use my internet access for instances that wifi isn't available.
I searched a lot but there wasn't any usefull clear guide. So after some failing attempts, finally i managed to succeed (using win 7). Here are the steps:
*root is required*
1. install http://code.google.com/p/android-wired-tether/ (i used stable version 1.2 but i don't think 1.4 will make any problems) but do not enable it yet.
2. Install USB drivers from Android SDK instructions found here: http://developer.android.com/sdk/win-usb.html , later you will also need RNDIS drivers because when you connect the tablet with your pc and enable wired tether it will install the drivers. I found working drivers from HTC sync located at C:\Program Files (x86)\HTC\HTC Driver\Driver Files\Win7_x64\htcrndis.inf
you have to install them manually from the device manager (pick the: HTC Remote NDIS based device)
3. now that we have completed the installation with Wired Tether (still leave it running), we are ready to proceed to the next step. Open network connections. You will notice that now there is one more. (in my case no1 is local area and no2 local area 5 (the one wired tether created). select the connection you want to share go to properties and enter "sharing tab". tick "Allow other network users to connect through this computer's Internet connection" and pick the connection made by wired tether. Hit apply and you will have bridged the two connections.
4. open any emulator on your tablet and type:
Code:
su
ifconfig usb0 192.168.1.9 netmask 255.255.255.0 up
route add default gw 192.168.1.1 dev usb0
setprop net.dns1 8.8.8.8
setprop "net.gprs.http-proxy" ""
netcfg usb0 dhcp
at ifconfig command you enter an available ip of your router for example if your pc is connected to 192.168.1.7 you can pick 192.168.1.9 that is free.
at the second line enter the default gateway of your internet connection found under the detailed view of its options.
setprop "net.gprs.http-proxy" "" is in case you are NOT behind a proxy server
5. wait about 15 seconds and...
enjoy!
each time you enable wired tether you have to type in:
su
netcfg usb0 dhcp
to undo the hole "reverse usb" thing, simply unbridge the 2 connections, restart wired tether and you are ready to use it for normal tethering.
browsers work fine, facebook, pulse, tunein. i haven't tested many apps yet...
issues: Market browsing is ok but downloading apps not, some apps do not work.
p.s: it's my first guide so if something seems confusing or unclear, please forgive me!
interesting... question... why do you do " setprop "net.gprs.http-proxy" """?
i'm asking because maybe this is what i'm missing in my usb 3g for my wifi only
thor2002ro said:
interesting... question... why do you do " setprop "net.gprs.http-proxy" """?
i'm asking because maybe this is what i'm missing in my usb 3g for my wifi only
Click to expand...
Click to collapse
forgot to implement the source link...
comments to focus are:
Rugga said...
I'm using Windows 7. I shared my ethernet internet connection to the USB tether device.
In console emulator on the phone I typed:
ifconfig usb1 192.168.2.2 netmask 255.255.255.0 up
route add default gw 192.168.2.1 dev usb1
I can ping the gateway, I can also ping the web by IP address, eg 64.233.181.104 for google.com
What I can't do is use the browser or ping by domain name. I tried:
setprop net.usb1.dns1 192.168.2.1; and
setprop net.dns1 192.168.2.1
Click to expand...
Click to collapse
OK it is working now. After setting up ICS type in console emulator on your phone:
ifconfig usb0 192.168.2.2 netmask 255.255.255.0 up
route add default gw 192.168.2.1 dev usb0
iptables -F
iptables -F -t nat
setprop net.dns1 8.8.8.8
setprop "net.gprs.http-proxy" ""
Click to expand...
Click to collapse
it gave me a headache trying to understand what exactly does this line...
the only thing i managed to figure out is tha it redirects and leaves blank proxy server via gprs connection... is it a fake connection (gprs) that blocks data transfer via usb from apps? the only sure thing is that these 2 lines with setprop command fixed the issue with the apps (browser and others)...
first is google's dns, probably necessary as well...
btw great job with the modules!
A quick question
Is this Iconia-specific or can the same method be used on any Android device provided we have working RNDIS drivers for it?
The way it appears to me, I don't see why it shouldn't work on other devices but please correct me if I am wrong.
HQRaja said:
Is this Iconia-specific or can the same method be used on any Android device provided we have working RNDIS drivers for it?
The way it appears to me, I don't see why it shouldn't work on other devices but please correct me if I am wrong.
Click to expand...
Click to collapse
in devices which already have the tethering ability, the hole wired tether thing doesn't need installation, so it is easier and i think it will work on any android based devices. so give it a try!
probably you won't even need to install RNDIS drivers, but in any case the HTC ones work like a charm (some other that i tried crashed windows upon connection).
you don't have to get specific RNDIS drivers especially for your device cause they are used for connecting usb devices used as network ones.
so... give it a try!
Exactly what i need desperately, i have a wifi signal which is very poor, i use external antenna to boost wifi signal. This external antenna has no drivers for android for sure, therefore i need to do reverse tethering to share internet connection from my computer.
I tried to use your guide but i think it needs a bit more details. I installed android tethering 1.4 but i am stuck at step 2 cause at this step when i turn on debugging mode on iconia then PC searches for drivers but doesn't accept the ones i downloaded from android SDK.
Kindly help me with this, i will be grateful for that.
Thanks.
usman3206 said:
Exactly what i need desperately, i have a wifi signal which is very poor, i use external antenna to boost wifi signal. This external antenna has no drivers for android for sure, therefore i need to do reverse tethering to share internet connection from my computer.
I tried to use your guide but i think it needs a bit more details. I installed android tethering 1.4 but i am stuck at step 2 cause at this step when i turn on debugging mode on iconia then PC searches for drivers but doesn't accept the ones i downloaded from android SDK.
Kindly help me with this, i will be grateful for that.
Thanks.
Click to expand...
Click to collapse
Hi! Sorry for my late answer to that. I've been away for a while...
try the drivers that are located at http://acer.us/ac/en/US/content/drivers
pick tablet, iconia tab, a500 and then download the usb drivers.
Any chance to enable this with an android phone? Wired tethering from the phone I mean.
There's actually a free program @ http://www.connectify.me
Its for Windows and they are developing an android app as well. But the windows software is quite easy and makes your computer or laptop a "hotspot" to connect multiple devices too.
enjoy!
Bec07 said:
Any chance to enable this with an android phone? Wired tethering from the phone I mean.
Click to expand...
Click to collapse
i'll give it a try (i assume you mean via usb connection).
connectify is for wireless networking. the hole reverse usb tethering thing is based on usb connection without any participation of a wireless network at all.
the majority of the latest android phones can become a hotspot natively anyway.
He does not want to install the driver from HTC. There are other options?
I found a way to enable Ethernet over USB OTG on a Samsung S6 Edge (SM-G925I, International Edition). The phone needs to be rooted because the method requires enabling the interface and editing routing tables.
The method has a "high" level of difficult, because it requires to enter commands on the phone using a terminal. By sharing this method, I hope experts will be able to automate this process, e.g., via an app.
While the description is for the Samsung S6 Edge, I suspect that this method may also be used on other phones.
Pre-requisites:
Tested on Samsung S6 Edge, SM-G925I, with Android v5.0.2 (Build LRX22G.G925IDVU1AOE3).
Phone must be rooted. This is necessary because you will be editing IP routing information which is only available with superuser access. Instructions for rooting the phone may be found elsewhere in XDA.
Set phone to "Airplane Mode" with Wi-Fi disabled. This simplifies the setup, but it is possible to lift this restriction. Left as an exercise to the reader.
Connect the phone to a micro USB OTG adapter. Then, connect the USB OTG adapter to a USB to RJ45 Ethernet adapter. Then, connect the Ethernet adapter to a router. (I have had good luck with BobjGear connectors and adapters. Sold by major online merchants.)
Setup
Your setup should look like this:
Samsung S6 Edge <-> Micro USB OTG connector <-> USB to RJ45 Ethernet adapter <-> Router <-> Internet
Enabling USB OTG interface
Using an app such as "Terminal Emulator" (by Jack Pavlevich) enter the following commands:
Check whether phone can reach router (that is, the gateway). Note: use the IP address of your router. Output shows that phone does not have access to any network.
Code:
$ ping -c 3 192.168.1.1
connect: Network is unreachable
(Optional) Check existing routing setup, useful for comparing after setup is completed.
Code:
# ip route // Should not show anything
# ip rule // Shows default rules (in my case, there are eight)
Confirm that the interface is visible to the phone.
Code:
$ netcfg
eth0 DOWN 0.0.0.0/0
The "eth0" interface corresponds to Ethernet over USB OTG. "DOWN" means that "eth0" is not active, resulting in the "Network is unreachable" message when pinging the router.
Now, gain superuser access:
Code:
$ su
Enable "eth0" interface. Router must be setup for DHCP.
Code:
# netcfg eth0 dhcp
If above command times out, try again. Otherwise try:
Code:
# netcfg eth0 down
# netcfg eth0 dhcp
Confirm that the interface is up and it has been assigned an IP address by the router. (IP address assigned to "eth0" will vary depending on your router setup.)
Code:
# netcfg
eth0 UP 192.168.1.21/24
Now, ping the router. (Note: Use your router's IP address.)
Code:
# ping -c 3 192.168.1.1
Network is unreachable
While interface is active and it has an IP address, phone still does not have access to any network.
Let's examine existing IP routing settings:
Code:
# ip route
The above command does not show any output, indicating that no IP routing is set up. In devices that support Ethernet over USB OTG off-the-shelf (e.g., Nexus 5, Sony Xperia Z1 phone and Z2 tablet), IP routing is setup "automatically". But in devices such as Samsung S6 Edge, IP routing settings need to be enabled manually using the commands below. (My guess is that Google, OEMs or carriers do not want you to use Ethernet over USB OTG.)
Configure IP routings
Configure IP routing in the "eth0" interface. The settings are similar to the ones used by the phone when the Wi-Fi interface is enabled. If the settings below do not work for you, check the IP routing settings on your phone when Wi-Fi is enabled and "eth0" is disabled, and adjust accordingly.
Code:
# ip rule add from all fwmark 0x101f9/0x1ffff lookup 1024 pref 13000
# ip rule add from all oif eth0 lookup 1024 pref 14000
# ip rule add from all fwmark 0x1f9/0x1ffff lookup 1024 pref 19000
# ip rule add from all fwmark 0x0/0xffff lookup 1024 pref 22000
# ip route add table 1024 192.168.1.0/24 dev eth0
# ip route add table 1024 default via 192.168.1.1 dev eth0
Exit superuser mode and (optionally) confirm IP routing settings.
Code:
# exit
$ ip rule // Command should show new entries 13000, 14000, 19000 and 22000
(Optional) Examine new IP routing settings and and newly created routing table entry.
Code:
$ ip route show table 1024
$ ip route
Both commands should output something like this:
Code:
default via 192.168.1.1 dev eth0 proto static
192.168.1.0/24 dev eth0 proto static scope link
Finally, confirm router is reachable from phone. (Note: use your router's IP address.)
Code:
$ ping -c 3 192.168.1.1
That's it! Your phone should now have Ethernet access over USB OTG. Enjoy!
Ps. Please hit 'Thanks' if this info was useful.
Would we have to perform this everytime we flash a new Rom?
Hello,
Could you give more details about which (BobjGear or others) USB to Ethernet adapters you tested with the S6 Edge?
I'd like to get one, but I'm confused about those which can work or not... The BobjGear page
http://www.bobjgear.com/which-tablets-support-ethernet.html
for their adapters states that they don't support Android phones, obviously if you managed to get it to work that is not entirely true
Thanks in advance for any detail you could provide, this is really a great achievement!
luckylui said:
Would we have to perform this everytime we flash a new Rom?
Click to expand...
Click to collapse
@luckylui Indeed, configuration done using these commands (via terminal or using a script) is not sticky, so you need to re-do it after reboot or after disconnecting/re-connecting the micro USB OTG adapter.
In other devices (such as Android tablets), configuration is done "automatically" (some "init.rc" takes care of this upon detecting than an Ethernet interface has been connect). However, for most Android phones this has to be done manually.
I hope that an XDA expert can help us create such a "init.rc" configuration script.
dew_veil said:
Hello,
Could you give more details about which (BobjGear or others) USB to Ethernet adapters you tested with the S6 Edge?
I'd like to get one, but I'm confused about those which can work or not... The BobjGear page
http://www.bobjgear.com/which-tablets-support-ethernet.html
for their adapters states that they don't support Android phones, obviously if you managed to get it to work that is not entirely true
Thanks in advance for any detail you could provide, this is really a great achievement!
Click to expand...
Click to collapse
Indeed, BobjGear's web page says that their adapters do not work for Android phones. However, they may actually refer to the issue that we discuss in this thread, that is, that Ethernet over USB OTG is not enabled in most Android phones by default. Therefore, BobjGear stays in the safe side by making that statement, so as customers don't blame them when Ethernet over USB OTG doesn't work on a phone.
I also have an Ethernet adapter from "Plugable" which does not work for this application because it is not a USB OTG adapter. The keyword here is "USB OTG", so if you purchase an adapter from another brand, make sure it is "USB OTG".
Yes, I think we are onto something useful here. To add to my OP:
I was able to use the same method (although with slightly different "ip rule" commands) with other phones: HTC One M9 and Samsung Galaxy Note 5. The method was the same: root the phone, enter the commands listed in the OP and "voila", the "eth0" interface works! (The first and third "ip rule" commands were slightly different for each phone because you have to match the rules that get set automatically by the phone when "wlan0" is active.)
I am using a script (run with superuser access) to enter the commands, as they are too many to type by hand. Also, I wrote a simple Android app that runs the script with superuser access, so now I don't even need to use a terminal.
I hope this info helps!
doedoejohn said:
Indeed, BobjGear's web page says that their adapters do not work for Android phones. However, they may actually refer to the issue that we discuss in this thread, that is, that Ethernet over USB OTG is not enabled in most Android phones by default. Therefore, BobjGear stays in the safe side by making that statement, so as customers don't blame them when Ethernet over USB OTG doesn't work on a phone.
I also have an Ethernet adapter from "Plugable" which does not work for this application because it is not a USB OTG adapter. The keyword here is "USB OTG", so if you purchase an adapter from another brand, make sure it is "USB OTG".
Yes, I think we are onto something useful here. To add to my OP:
I was able to use the same method (although with slightly different "ip rule" commands) with other phones: HTC One M9 and Samsung Galaxy Note 5. The method was the same: root the phone, enter the commands listed in the OP and "voila", the "eth0" interface works! (The first and third "ip rule" commands were slightly different for each phone because you have to match the rules that get set automatically by the phone when "wlan0" is active.)
I am using a script (run with superuser access) to enter the commands, as they are too many to type by hand. Also, I wrote a simple Android app that runs the script with superuser access, so now I don't even need to use a terminal.
I hope this info helps!
Click to expand...
Click to collapse
Do you think you could share that app for the note 5?
Do apps access ethernet?
Thank you for this useful op.
Following your concept (S6 edge device rooted and using Alex-V kernel) I have no trouble with pings via terminal however all apps still see internet as disconnected.
Do your apps connect to the internet on all the phones with which you used this method?
Does the kernel have to support USB-Ethernet or is this not kernel related?
doedoejohn said:
Indeed, BobjGear's web page says that their adapters do not work for Android phones. However, they may actually refer to the issue that we discuss in this thread, that is, that Ethernet over USB OTG is not enabled in most Android phones by default. Therefore, BobjGear stays in the safe side by making that statement, so as customers don't blame them when Ethernet over USB OTG doesn't work on a phone.
I also have an Ethernet adapter from "Plugable" which does not work for this application because it is not a USB OTG adapter. The keyword here is "USB OTG", so if you purchase an adapter from another brand, make sure it is "USB OTG".
Yes, I think we are onto something useful here. To add to my OP:
I was able to use the same method (although with slightly different "ip rule" commands) with other phones: HTC One M9 and Samsung Galaxy Note 5. The method was the same: root the phone, enter the commands listed in the OP and "voila", the "eth0" interface works! (The first and third "ip rule" commands were slightly different for each phone because you have to match the rules that get set automatically by the phone when "wlan0" is active.)
I am using a script (run with superuser access) to enter the commands, as they are too many to type by hand. Also, I wrote a simple Android app that runs the script with superuser access, so now I don't even need to use a terminal.
I hope this info helps!
Click to expand...
Click to collapse
Hello, this is fascinating. I want to set this up on my LG G2 D801, only I don't know what "ip rule" commands I should enter. How can I find out the rules the phone sets when "wlan0" is active?
This post needs more recognition and attention than it has. XDA Admins should frontpage it imho. I have a friend who has a Nexus 9 and Ethernet dongles work out of the box. Samsung devices though is an other story. Me and my boss are setting up networks for small businesses. It would have been amazing if we could enable on our Samsung phones (S5 him and S7 me) Ethernet support as it would save us from having to carry on not-easy-to-access places heavy equipment to set up the network or troubleshoot issues that WiFi is not an option. I wish there was an app or a script that would do the work for you. In any way, good job, actually, spectacular job!
Hello,
how can I use ethernet with my S6 with Android 6?
doedoejohn said:
I found a way to enable Ethernet over USB OTG on a Samsung S6 Edge (SM-G925I, International Edition). The phone needs to be rooted because the method requires enabling the interface and editing routing tables.
The method has a "high" level of difficult, because it requires to enter commands on the phone using a terminal. By sharing this method, I hope experts will be able to automate this process, e.g., via an app.
While the description is for the Samsung S6 Edge, I suspect that this method may also be used on other phones.
Pre-requisites:
Tested on Samsung S6 Edge, SM-G925I, with Android v5.0.2 (Build LRX22G.G925IDVU1AOE3).
Phone must be rooted. This is necessary because you will be editing IP routing information which is only available with superuser access. Instructions for rooting the phone may be found elsewhere in XDA.
Set phone to "Airplane Mode" with Wi-Fi disabled. This simplifies the setup, but it is possible to lift this restriction. Left as an exercise to the reader.
Connect the phone to a micro USB OTG adapter. Then, connect the USB OTG adapter to a USB to RJ45 Ethernet adapter. Then, connect the Ethernet adapter to a router. (I have had good luck with BobjGear connectors and adapters. Sold by major online merchants.)
Setup
Your setup should look like this:
Samsung S6 Edge <-> Micro USB OTG connector <-> USB to RJ45 Ethernet adapter <-> Router <-> Internet
Enabling USB OTG interface
Using an app such as "Terminal Emulator" (by Jack Pavlevich) enter the following commands:
Check whether phone can reach router (that is, the gateway). Note: use the IP address of your router. Output shows that phone does not have access to any network.
Code:
$ ping -c 3 192.168.1.1
connect: Network is unreachable
(Optional) Check existing routing setup, useful for comparing after setup is completed.
Code:
# ip route // Should not show anything
# ip rule // Shows default rules (in my case, there are eight)
Confirm that the interface is visible to the phone.
Code:
$ netcfg
eth0 DOWN 0.0.0.0/0
The "eth0" interface corresponds to Ethernet over USB OTG. "DOWN" means that "eth0" is not active, resulting in the "Network is unreachable" message when pinging the router.
Now, gain superuser access:
Code:
$ su
Enable "eth0" interface. Router must be setup for DHCP.
Code:
# netcfg eth0 dhcp
If above command times out, try again. Otherwise try:
Code:
# netcfg eth0 down
# netcfg eth0 dhcp
Confirm that the interface is up and it has been assigned an IP address by the router. (IP address assigned to "eth0" will vary depending on your router setup.)
Code:
# netcfg
eth0 UP 192.168.1.21/24
Now, ping the router. (Note: Use your router's IP address.)
Code:
# ping -c 3 192.168.1.1
Network is unreachable
While interface is active and it has an IP address, phone still does not have access to any network.
Let's examine existing IP routing settings:
Code:
# ip route
The above command does not show any output, indicating that no IP routing is set up. In devices that support Ethernet over USB OTG off-the-shelf (e.g., Nexus 5, Sony Xperia Z1 phone and Z2 tablet), IP routing is setup "automatically". But in devices such as Samsung S6 Edge, IP routing settings need to be enabled manually using the commands below. (My guess is that Google, OEMs or carriers do not want you to use Ethernet over USB OTG.)
Configure IP routings
Configure IP routing in the "eth0" interface. The settings are similar to the ones used by the phone when the Wi-Fi interface is enabled. If the settings below do not work for you, check the IP routing settings on your phone when Wi-Fi is enabled and "eth0" is disabled, and adjust accordingly.
Code:
# ip rule add from all fwmark 0x101f9/0x1ffff lookup 1024 pref 13000
# ip rule add from all oif eth0 lookup 1024 pref 14000
# ip rule add from all fwmark 0x1f9/0x1ffff lookup 1024 pref 19000
# ip rule add from all fwmark 0x0/0xffff lookup 1024 pref 22000
# ip route add table 1024 192.168.1.0/24 dev eth0
# ip route add table 1024 default via 192.168.1.1 dev eth0
Exit superuser mode and (optionally) confirm IP routing settings.
Code:
# exit
$ ip rule // Command should show new entries 13000, 14000, 19000 and 22000
(Optional) Examine new IP routing settings and and newly created routing table entry.
Code:
$ ip route show table 1024
$ ip route
Both commands should output something like this:
Code:
default via 192.168.1.1 dev eth0 proto static
192.168.1.0/24 dev eth0 proto static scope link
Finally, confirm router is reachable from phone. (Note: use your router's IP address.)
Code:
$ ping -c 3 192.168.1.1
That's it! Your phone should now have Ethernet access over USB OTG. Enjoy!
Ps. Please hit 'Thanks' if this info was useful.
Click to expand...
Click to collapse
First of all, thank you for this great work. I need ethernet connection and my tablet (lenovo yoga tab 3) had no ethernet access.
Now, following your instuctions I have managed to ping the router from the terminal, but then I do not load any page the browser and I do not connect the apps. Do I need to do anything else? Or am I doing something wrong?
Could you help me please?
Thanks in advance!
doedoejohn said:
Code:
# ip rule add from all fwmark 0x1f9/0x1ffff lookup 1024 pref 19000
Click to expand...
Click to collapse
Hello, I am trying to do the same for my note 4.
I am currently able to ping google.com without having changed the ip rule tables.
But all my apps are still not able to recognize the ethernet connection.
So I am digging into those ip rule tables.
My question is, how did you find that value 0x1f9 ?
I have analyzed dozen of ip route policy databases and I have roughly understood how they are built.
But it seems this value differs from an interface to another (wlan0, eth0, rmnet, ...). Seems it's a kind of network ID ?
Also, would it be possible to have your ip route policy table with wlan0 and the final one for eth0 with your tweak ?
Thanks
hello
i would like to know if there is a script to enable ethernet...i've a lenovo tablet, the usb dongle is well recognize by android but no ethernet connection is made...
Thank you for sharing this, novebis!
Getting ethernet working on my used tablet was the reason for my purchasing it and the reason I joined the forums.
This worked on my ASUS Memopad 8 ME181C K011 (rooted with locked boot loader) with a "Pluggable USB 2.0 Ethernet Adapter 10/100 Mbps", Model USB2-E100, hanging off of a "Micro USB OTG Charge HUB For Smartphone and Tablet".
I've got the "Pluggable USB 2.0 OTG Ethernet Adapter 10/100 Mbps", model USB2-OTGE100, also which I suspect will work without any changes. I also have a USB 3 gigabit model from a different manufacturer with a similar but newer SoC which I'll try. A Chromecast powered version from UGREEN is also on the way for testing.
I'll be looking for an automated method for this and for a way to make Google Play use the connection.
Thanks so much. I'm stoked
On Note 5, I can ping google.com and Chrome is working via the cable. But all other apps don't, like Google Photos, Youtube, Facebook.
Any idea why?
The script in this thread didn't work correctly so I had to improvise my own as below:
ifconfig eth0 10.1.1.50 netmask 255.255.255.0 broadcast 10.1.1.255
ifconfig eth0 up
ndc network create 9792
ndc network interface add 9792 usb0
ndc network route add 9792 usb0 0.0.0.0/0 192.168.225.1
ndc resolver setnetdns 9792 8.8.8.8 8.8.4.4
ndc network default set 9792
Click to expand...
Click to collapse
dan.leahu said:
On Note 5, I can ping google.com and Chrome is working via the cable. But all other apps don't, like Google Photos, Youtube, Facebook.
Any idea why?
The script in this thread didn't work correctly so I had to improvise my own as below:
Click to expand...
Click to collapse
Although I have a different device, I've given up on this and switched, instead, to a virtual android device.
There are some apps relating to fake WiFi which are supposed to address this issue but I've had no luck in getting some apps (e.g. Google Play) to use ethernet. I've also had limited results using reverse USB tethering.
What you're trying to do is what many would want. However, it's simply too good of an idea for the producers of proprietary systems and operating systems to tolerate. Efforts to give the people what they want seem to fall into a black hole of silence.
"Dive Into Android Networking: Adding Ethernet Connectivity - ELCE 21"
https://www.youtube.com/watch?v=LwI2NBq7BWM
Slides
https://www.elinux.org/images/9/98/Dive_Into_Android_Networking-_Adding_Ethernet_Connectivity.pdf
HD version of the video here...
https://bootlin.com/pub/video/2012/elce/elce-2012-zores-android-networking-ethernet-support.webm
Products resulting from the above work:
Premium DeskPhones
https://www.al-enterprise.com/en/products/devices/premium-deskphones
AngrySockPuppet said:
Although I have a different device, I've given up on this and switched, instead, to a virtual android device.
There are some apps relating to fake WiFi which are supposed to address this issue but I've had no luck in getting some apps (e.g. Google Play) to use ethernet. I've also had limited results using reverse USB tethering.
What you're trying to do is what many would want. However, it's simply too good of an idea for the producers of proprietary systems and operating systems to tolerate. Efforts to give the people what they want seem to fall into a black hole of silence.
"Dive Into Android Networking: Adding Ethernet Connectivity - ELCE 21"
https://www.youtube.com/watch?v=LwI2NBq7BWM
Slides
https://www.elinux.org/images/9/98/Dive_Into_Android_Networking-_Adding_Ethernet_Connectivity.pdf
HD version of the video here...
https://bootlin.com/pub/video/2012/elce/elce-2012-zores-android-networking-ethernet-support.webm
Products resulting from the above work:
Premium DeskPhones
https://www.al-enterprise.com/en/products/devices/premium-deskphones
Click to expand...
Click to collapse
Thank you so much, never knew such research exists on this.
So does it mean there's no way to do it?
I thought I was close, as after the script above I've further did some changes and now Google Play works via Ethernet Cable. I can download apps, which wasn't working before.
Added command:
Code:
ip rule add from all lookup main pref 1
But still, WhatsApp and Google Photos still miss the connection. I really can't understand why?!
Oh now I see from the slides:
• Java framework services and apps rely on Connectivity Manager
and have no clue what Ethernet route/connection actually means.
- Except for some apps (e.g. Browser, which relies on native implementation).
Click to expand...
Click to collapse
Actually found this which does a reverse tethering via USB cable + Linux computer. Hope it'll work better than trying to get Ethernet connection work.
https://github.com/vvviperrr/SimpleRT
found at:
https://news.ycombinator.com/item?id=12198085
dan.leahu said:
Thank you so much, never knew such research exists on this.
So does it mean there's no way to do it?
I thought I was close, as after the script above I've further did some changes and now Google Play works via Ethernet Cable. I can download apps, which wasn't working before.
Added command:
Code:
ip rule add from all lookup main pref 1
But still, WhatsApp and Google Photos still miss the connection. I really can't understand why?!
Oh now I see from the slides:
Click to expand...
Click to collapse
Congratulations on getting Google Play to work. That's a big accomplishment.
You're way ahead of me though.
Perhaps you will have better luck with the fake WiFi apps as well.
My main interest in this is to use social media apps without wireless.
Hi everybody,
I have a problem with the ethernet connection in the Samsung Galaxy Tab 4 8' WiFi (SM-T330).
I need to connect the tablet to a embedded system through ethernet with a static IP address, and in order to achieve this I use a MicroUSB-RJ45 adapter that in android 4.4.2 works perfectly fine, but when I upgraded to android 5.1.1 the ethernet connection stopped working.
A key requirement I have is that the IP address must be static. This is important because making some research I've connected the tablet to a LAN and with ethernet configured as DHCP and I have internet connection, but when I change the configuration of the connection to a static IP I can't even make ping to the gateway. If I execute in a terminal emulator the command 'netcfg' I can see the interface eth0 up with the correct IP assigned (192.168.1.98). If I run the command 'ip route show' I can see the following in the output:
default via 192.168.1.1 dev eth0
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.98
Which is apparently correct IMO, but the fact is that if I ping the 192.168.1.1 address I get "Network is unreachable" error.
Just to compare, the output of 'netcfg' and 'ip route show' in case of DHCP configuration is pretty much the same:
default via 192.168.1.1 dev eth0 metric 238
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.179 metric 238
But this time everything works fine.
I have no clue why it doesn't work with a static IP. Can anybody help me with this issue? I'm doing something wrong, or this is an android 5.1.1 bug?
Thanks in advance.
pazonks said:
Hi everybody,
I have a problem with the ethernet connection in the Samsung Galaxy Tab 4 8' WiFi (SM-T330).
I need to connect the tablet to a embedded system through ethernet with a static IP address, and in order to achieve this I use a MicroUSB-RJ45 adapter that in android 4.4.2 works perfectly fine, but when I upgraded to android 5.1.1 the ethernet connection stopped working.
A key requirement I have is that the IP address must be static. This is important because making some research I've connected the tablet to a LAN and with ethernet configured as DHCP and I have internet connection, but when I change the configuration of the connection to a static IP I can't even make ping to the gateway. If I execute in a terminal emulator the command 'netcfg' I can see the interface eth0 up with the correct IP assigned (192.168.1.98). If I run the command 'ip route show' I can see the following in the output:
default via 192.168.1.1 dev eth0
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.98
Which is apparently correct IMO, but the fact is that if I ping the 192.168.1.1 address I get "Network is unreachable" error.
Just to compare, the output of 'netcfg' and 'ip route show' in case of DHCP configuration is pretty much the same:
default via 192.168.1.1 dev eth0 metric 238
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.179 metric 238
But this time everything works fine.
I have no clue why it doesn't work with a static IP. Can anybody help me with this issue? I'm doing something wrong, or this is an android 5.1.1 bug?
Thanks in advance.
Click to expand...
Click to collapse
how to you connect tablet with LAN cable?
thelous said:
how to you connect tablet with LAN cable?
Click to expand...
Click to collapse
They said (and I quote):
in order to achieve this I use a MicroUSB-RJ45 adapter that in android 4.4.2 works perfectly fine, but when I upgraded to android 5.1.1 the ethernet connection stopped working.
Click to expand...
Click to collapse
thisisapoorusernamechoice said:
They said (and I quote):
Click to expand...
Click to collapse
Ohh i thought he mean tab 4 8.0 had ethernet port LOL., but why use LAN cable whek you can get same speed with wifi? Atleast i am getting same speed on tablet as i have on desktop computer....
I believe I am having the same problem. Any word on what is going on?
I was able to get UDP messages out to work intermittently by finding a network that it would connect with and then connecting it back into the network I wanted it to work with. I could not get the initial connection consistently, though.
I was able to get everything working again by flashing 4.4.2 onto the tablet, factory resetting, not letting anything update, and setting up my Ethernet network.