Here is basically a run-down of what I did. I hope this helps everyone out.
Device specs:
Samsung Galaxy Player 4.0 Rooted
Network Specs:
DSL Modem
Router (DHCP with WPA security and does not have MAC Filtering)
4 Access Points (all on same channel broadcasting same SSID with same WPA security DHCP)
2 Servers - Static IPs
-Server 1 - DNS (not sure if it is actually a DNS server or just forwards the requests). Also storage/application server.
-Server 2 - Storage/Application/SQL server
Many clients on network (unsure of total amount but somewhere around 30 would be my guess)
Problem (note this is only on this network, every other network wifi
works just fine):
Wifi Connected but no internet.
My Windows 7 laptop (same network) gets internet access with no problems
No reports of any other clients on the network having this issue
Device has assigned a good DHCP IP address
Subnet, Gateway, and DNS IPs are all correct (they match the ones on my laptop)
Connection strength is great (speed is 52mbps)
Device has full local access (intranet). It can access all files and other devices on the network.
On occasion the device will get "internet" access for a brief period of time but will go back to "intranet" access only after a few minutes.
Tests Performed (My android device will be referred to as "device" my laptop will be reffered to as "laptop". All tests were performed with both laptop and device connected to the network in question, unless otherwise specified, and device was not able to access internet):
Ping from laptop to device - Successful
Ping from device to laptop - Successful
Ping from laptop to gateway - Successful
Ping from device to gateway - Failed
Resolve DNS IP on device - Successful
Resolve DNS IP on laptop - Successful
Ping from laptop to google - Successful
Ping from device to google - Failed
Small FTP file transfer from laptop to device - Successful
Small FTP file transfer from device to laptop - Successful
Device has no problems on other networks (tried un-secured, WEP, and WPA/WPA2)
Connect device using Google public DNS servers
-Intranet - Successful
-Internet - Failed
-Resolve DNS IP - Successful
Connect laptop using Google public DNS servers
-Intranet - Successful
-Internet - Successful
-Resolve DNS IP - Successful
More that I cannot remember right now. Will add as they come to me.
At this point I gave up for a few days. Every test and every bit of research returned nothing. I had spent many many hours trying to figure this out and testing theories and nothing ever pointed me in the right direction of where to go. Nothing made sense EVERY single setting is the same is on my laptop. Started thinking maybe there was something in the router that could be blocking Android devices (since it is a work network). Although I am not a aware of a router feature to do that I figure I would try some more tests.
Testing Round 2 (same conditions as initial tests):
Configured laptop to be a Wifi hotspot.
-From CMD command 1: netsh wlan set hostednetwork mode=allow ssid=AP key=XXXXXXXXX
-From CMD command 2: netsh wlan start hostednetwork
-From network and sharing center: Shared the physical wireless network connection with the Microsoft Virtual WiFi Miniport Adapter.
-The above commands create a virtual wireless adapter and set it broadcast the specified SSID with the specified WPA security key. Then you can choose any available, connected, physical, internet connection and share it's internet connection with the virtual connection, thus theorectically turning my laptop into a 5th access point on the network.
Connected device to the SSID "AP"
-Intranet - Successful
-Internet - SUCCESSFUL
Horray!!!! Progress! So with the above information I went to our IT guy and we sat down and looked at some stuff (settings in the router, access points, and servers). After digging and digging around within the settings we came up with.... you guessed it NOTHING!!!!!!!!!!!!! Now I was in "Its on!" mode and decided I wasn't going to stop until I found out at least what was causing the problem. My IT guy was also very determined to figure this out as he doesn't like to get beat either. So we both went at it. We decided the first thing to do was make a very detailed network map containing every piece of information we could possibly find. We did this all from his machine (laptop with Windows 7) and wrote everything down on paper (we even used a piece of our 36" wide roll paper from our plotter to make sure everything would fit) and made an excel spredsheet with all the info. Now with the newly aquired network information I decided I was going to do more testing.
Testing Round 3 (same conditions as initial test):
Map the entire network again gathering every piece of information possible just like before but this time using MY DEVICE (not my laptop).
Compare
Finally! I have found the problem! As stated before my device was getting the correct gateway IP (XXX.XXX.XXX.1) which is the same as my laptop). However the assigned MAC address OF THE GATEWAY (router) to my device is XX:XX:XX:XX:XX:FB but the MAC address OF THE GATEWAY (router) to my laptop is XX:XX:XX:XX:XX:FA. Got back with our IT guy and we found (by looking the router config) that the XX:XX:XX:XX:XX:FA is the LAN MAC address for the router. The XX:XX:XX:XX:XX:FB is the WAN MAC address for the router.
Testing Round 4 (same conditions as intial test):
Connected laptop to network, confirmed XX:XX:XX:XX:XX:FA MAC address was assigned for the gateway by running "arp -a" in CMD.
-Pinged google - Passed
-Changed assigned MAC address of gateway by running "arp -s XXX.XXX.XXX.1 XX:XX:XX:XX:XX:FB" in CMD
-Verified new MAC address assignment by running "arp -a" in CMD
-Pinged google - Failed
-Changed the MAC back and pinged google again - Successful
Connected device to network, confirmed XX:XX:XX:XX:XX:FB MAC address was assigned for the gateway by running "arp -a" in Terminal.
-Pinged google - Failed
-Changed assigned MAC address of gateway by running "su" then "arp -s XXX.XXX.XXX.1 XX:XX:XX:XX:XX:FA" in Terminal
-Verified new MAC address assignment by running "arp -a" in Terminal
-Pinged google - Successful
-Changed the MAC back and pinged google again - Failed
Conclusion:
For some reason the device is getting assigned the correct gateway IP but the wrong gateway MAC. This is allowing the device to connect to the network but not communicate with the router. Since it can't communicate with the router any "Internet" requests time out because the packets have to go through the router to make it to the "Internet". Since it is not blocked from the network it can still connect and communicate with other clients on the "Intranet" but not the router.
Our IT guy thinks there is a client somewhere on the network in the same subnet that is configured in this matter and it just so happens that for some reason my device is picking that up when it connects. He is going to look into it more when time permits but since we are very busy and we have already spent way too much time on this, and I now know at least what the issue is, he is going to move on for now.
Why would my device be picking up the WAN MAC address of the router?
What would be responsible for assigning a WAN or LAN MAC address?
How can I prevent this?
Has anyone ever experienced anything like this?
Temporary Solution (must be rooted):
Open your favorite terminal app on your device.
-Enter "su" (without quotes)
-Enter "arp -s [Your gateway IP here] [Your gateway's LAN MAC address here]
Browse away!!!!!
Hello.
I had the same problem, that I could connect to router but had no connection to internet.
Read this post and started to do some research on my router. When I configurated my router, there was an option to clone MAC address. And of course to get it done fast I cloned MAC. And now I checked that it cloned my laptop MAC. Changed MAC from laptop to Routers MAC (must be on label under router) and got a really nice internet connection.
Hi, I think I have the same problem with the same device, Samsung Galaxy Player 4, but even if my device is rooted I still can't excecute the "arp" command from the Terminal application (there is no "arp" command). How can I check/modify the arp list on my device???
I really appreciate your help. Thanks in advance!!!
I use the terminal emulator app. It works just fine for me and I never had to download any other software to be able to run the ARP command.
bmx0964 said:
Here is basically a run-down of what I did. I hope this helps everyone out.
Temporary Solution (must be rooted):
Open your favorite terminal app on your device.
-Enter "su" (without quotes)
-Enter "arp -s [Your gateway IP here] [Your gateway's LAN MAC address here]
Browse away!!!!!
Click to expand...
Click to collapse
anyone found a solution to this ?
just updated to ics4 and cannot connect to the internet.
You only have one device that assigns IP adresses, right?
How about changing the channel to see if that works? or maybe even the security protocol
greeky510 said:
You only have one device that assigns IP adresses, right?
How about changing the channel to see if that works? or maybe even the security protocol
Click to expand...
Click to collapse
the only thing that worked for me is to turn on the dhcp option
in my router. previously, i was using static ips
may_east said:
the only thing that worked for me is to turn on the dhcp option
in my router. previously, i was using static ips
Click to expand...
Click to collapse
I had the sams problem. I could connect with my wifi but had no internet acces. The solution here was the wifi encription.
My smartphone could not encript the hard encription I think. With WEP encription it all works well.
Hey guys,
Here's a run down of the problem I'm currently having. A few months ago I purchased a Dapeng A75 currently running ICS 4.0. Although a beautiful and fast phone, just recently it started going out of wack.
- Youtube and Play Store hang on "Loading" screen
- My Gmail accounts won't sync
- I can no longer search on Google.com with ANY browser through WiFi. (I do not have data service on my phone)
I've tried several attempts at troubleshooting this, all which have failed.
- I restored my phone to factory default.
- Uninstalled and reinstalled these apps.
- Downgraded the apps to previous versions.
- Cleared my cache on just about everything.
- Release and renewed my IP in Terminal.
Just recently I noticed a CWM recovery image posted and I figure this is the only solution. Wiping out the phone and flashing a fresh ROM but unfortunately I can only get as far as installing the drivers to my Windows 7 machine. Some reason when I plug the phone in after installing the drivers, Windows will prompt me that the device is plugged in but before I get a chance to hit F9 for SP Flash Tool to do it's thing, the device quickly disconnects.
NOTE: I am able to browse Google via WiFi only by using HotSpot Shield VPN (Which is problematic in itself).
I'm currently losing the battle with this phone and at my wits end. Is there anyone out there who is experiencing the same situation or has some sort of solution which doesn't involve be shelling out more money for a new phone?
good work brother
i understood the above problem n i too experienced the same problems so now i will take ur research to next level n see my know of network .
i appreciate all the work done you , in research of this LITTLE but hetic problem.
i have learned a lot through u r research.
n will do more n keep u guys posted if i found somthing on this
---------- Post added at 11:11 AM ---------- Previous post was at 11:06 AM ----------
bmx0964 said:
Here is basically a run-down of what I did. I hope this helps everyone out.
Device specs:
Samsung Galaxy Player 4.0 Rooted
Network Specs:
DSL Modem
Router (DHCP with WPA security and does not have MAC Filtering)
4 Access Points (all on same channel broadcasting same SSID with same WPA security DHCP)
2 Servers - Static IPs
-Server 1 - DNS (not sure if it is actually a DNS server or just forwards the requests). Also storage/application server.
-Server 2 - Storage/Application/SQL server
Many clients on network (unsure of total amount but somewhere around 30 would be my guess)
Problem (note this is only on this network, every other network wifi
works just fine):
Wifi Connected but no internet.
My Windows 7 laptop (same network) gets internet access with no problems
No reports of any other clients on the network having this issue
Device has assigned a good DHCP IP address
Subnet, Gateway, and DNS IPs are all correct (they match the ones on my laptop)
Connection strength is great (speed is 52mbps)
Device has full local access (intranet). It can access all files and other devices on the network.
On occasion the device will get "internet" access for a brief period of time but will go back to "intranet" access only after a few minutes.
Tests Performed (My android device will be referred to as "device" my laptop will be reffered to as "laptop". All tests were performed with both laptop and device connected to the network in question, unless otherwise specified, and device was not able to access internet):
Ping from laptop to device - Successful
Ping from device to laptop - Successful
Ping from laptop to gateway - Successful
Ping from device to gateway - Failed
Resolve DNS IP on device - Successful
Resolve DNS IP on laptop - Successful
Ping from laptop to google - Successful
Ping from device to google - Failed
Small FTP file transfer from laptop to device - Successful
Small FTP file transfer from device to laptop - Successful
Device has no problems on other networks (tried un-secured, WEP, and WPA/WPA2)
Connect device using Google public DNS servers
-Intranet - Successful
-Internet - Failed
-Resolve DNS IP - Successful
Connect laptop using Google public DNS servers
-Intranet - Successful
-Internet - Successful
-Resolve DNS IP - Successful
More that I cannot remember right now. Will add as they come to me.
At this point I gave up for a few days. Every test and every bit of research returned nothing. I had spent many many hours trying to figure this out and testing theories and nothing ever pointed me in the right direction of where to go. Nothing made sense EVERY single setting is the same is on my laptop. Started thinking maybe there was something in the router that could be blocking Android devices (since it is a work network). Although I am not a aware of a router feature to do that I figure I would try some more tests.
Testing Round 2 (same conditions as initial tests):
Configured laptop to be a Wifi hotspot.
-From CMD command 1: netsh wlan set hostednetwork mode=allow ssid=AP key=XXXXXXXXX
-From CMD command 2: netsh wlan start hostednetwork
-From network and sharing center: Shared the physical wireless network connection with the Microsoft Virtual WiFi Miniport Adapter.
-The above commands create a virtual wireless adapter and set it broadcast the specified SSID with the specified WPA security key. Then you can choose any available, connected, physical, internet connection and share it's internet connection with the virtual connection, thus theorectically turning my laptop into a 5th access point on the network.
Connected device to the SSID "AP"
-Intranet - Successful
-Internet - SUCCESSFUL
Horray!!!! Progress! So with the above information I went to our IT guy and we sat down and looked at some stuff (settings in the router, access points, and servers). After digging and digging around within the settings we came up with.... you guessed it NOTHING!!!!!!!!!!!!! Now I was in "Its on!" mode and decided I wasn't going to stop until I found out at least what was causing the problem. My IT guy was also very determined to figure this out as he doesn't like to get beat either. So we both went at it. We decided the first thing to do was make a very detailed network map containing every piece of information we could possibly find. We did this all from his machine (laptop with Windows 7) and wrote everything down on paper (we even used a piece of our 36" wide roll paper from our plotter to make sure everything would fit) and made an excel spredsheet with all the info. Now with the newly aquired network information I decided I was going to do more testing.
Testing Round 3 (same conditions as initial test):
Map the entire network again gathering every piece of information possible just like before but this time using MY DEVICE (not my laptop).
Compare
Finally! I have found the problem! As stated before my device was getting the correct gateway IP (XXX.XXX.XXX.1) which is the same as my laptop). However the assigned MAC address OF THE GATEWAY (router) to my device is XX:XX:XX:XX:XX:FB but the MAC address OF THE GATEWAY (router) to my laptop is XX:XX:XX:XX:XX:FA. Got back with our IT guy and we found (by looking the router config) that the XX:XX:XX:XX:XX:FA is the LAN MAC address for the router. The XX:XX:XX:XX:XX:FB is the WAN MAC address for the router.
Testing Round 4 (same conditions as intial test):
Connected laptop to network, confirmed XX:XX:XX:XX:XX:FA MAC address was assigned for the gateway by running "arp -a" in CMD.
-Pinged google - Passed
-Changed assigned MAC address of gateway by running "arp -s XXX.XXX.XXX.1 XX:XX:XX:XX:XX:FB" in CMD
-Verified new MAC address assignment by running "arp -a" in CMD
-Pinged google - Failed
-Changed the MAC back and pinged google again - Successful
Connected device to network, confirmed XX:XX:XX:XX:XX:FB MAC address was assigned for the gateway by running "arp -a" in Terminal.
-Pinged google - Failed
-Changed assigned MAC address of gateway by running "su" then "arp -s XXX.XXX.XXX.1 XX:XX:XX:XX:XX:FA" in Terminal
-Verified new MAC address assignment by running "arp -a" in Terminal
-Pinged google - Successful
-Changed the MAC back and pinged google again - Failed
Conclusion:
For some reason the device is getting assigned the correct gateway IP but the wrong gateway MAC. This is allowing the device to connect to the network but not communicate with the router. Since it can't communicate with the router any "Internet" requests time out because the packets have to go through the router to make it to the "Internet". Since it is not blocked from the network it can still connect and communicate with other clients on the "Intranet" but not the router.
Our IT guy thinks there is a client somewhere on the network in the same subnet that is configured in this matter and it just so happens that for some reason my device is picking that up when it connects. He is going to look into it more when time permits but since we are very busy and we have already spent way too much time on this, and I now know at least what the issue is, he is going to move on for now.
Why would my device be picking up the WAN MAC address of the router?
What would be responsible for assigning a WAN or LAN MAC address?
How can I prevent this?
Has anyone ever experienced anything like this?
Temporary Solution (must be rooted):
Open your favorite terminal app on your device.
-Enter "su" (without quotes)
-Enter "arp -s [Your gateway IP here] [Your gateway's LAN MAC address here]
Browse away!!!!!
Click to expand...
Click to collapse
i would like to add if u have seen the
cmd-ncpa.cpl-ipv4-propreties- in this section u see its Dhcp so all fields are inactive
but u can see gateway ip which is inactive such as in my case 192.168.1.1
u cannot remove that.
any body saw the reply....
thanks regards
bmx0964 said:
Temporary Solution (must be rooted):
Open your favorite terminal app on your device.
-Enter "su" (without quotes)
-Enter "arp -s [Your gateway IP here] [Your gateway's LAN MAC address here]
Browse away!!!!!
Click to expand...
Click to collapse
Thanks, This Solution Saved me Today
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.