setting up Ethernet connection (progress report) - Galaxy S6 Q&A, Help & Troubleshooting

Hello, I'm attempting to setup up ethernet on my G920F using bobjgear usb 2.0 ethernet adapter.
Here is my progress:
1. Rooted with Xtrestolite 5.1.1, Vindicator kernel, busybox.
2. app to turn on eth0 is called "Ethernet Droid":
-assigned IP (within range) (192.168.1.67)
-assigned default gateway (192.168.1.254)
-assigned subnetmask (255.255.255.0)
-NOT assigned DNS
3. terminal emulator shows eth0 as UP with the IP assigned.
4. my ATT U-verse router shows a device connected with the assigned IP.
in terminal emulator when typing:
# netcfg eth0 dhcp
I get:
# action 'dhcp' failed (operation not permitted)
in terminal emulator when typing:
# ifconfig eth0
I get:
# eth0: ip 192.168.1.254 mask 255.255.255.0 flags [up broadcast running multicast]
in terminal emulator when typing:
# ping -c 4 192.168.1.254
I get:
# connect: Network is unreachable
-----------------------------------------
This is as far as I've been able to get, any further progress would be greatly appreciated, as I'm really trying to set up ethernet chromecast with a portable router for display out. A lot of people have complained of the lack of MHL and HDMI support which was really a shock to me when I found out...
I'm not a coder, nor an export on linux, so any help please keep the instructions simple and clear, thank you really truly.

sergeivich said:
# ping -c 4 192.168.1.254
I get:
# connect: Network is unreachable
Click to expand...
Click to collapse
I guess this is a Android 5.x bug or missing permission.
Please try the following:
1. su (in your terminal)
2. netcfg eth0 dhcp (this should work as superuser)
3. exit
4. ping your IP of your mobile phone ping -c4 192.168.1.XXX (this should work)
5. su
6. ping your gateway ip ping -c 4 192.168.1.YYY (this should work as superuser)
7. exit
8. ping your gateway ip ping -c 4 192.168.1.YYY (do you get now: android connect network is unreachable ?)
Until CM11 (Android 4.4.4) I could use my eth0 interface as normal user for everything. In oder to switch between wlan0 and eth0 you can use the ethernet-2.XX.apk. Some APPs absolutely want wlan0. For these APPs you could install one of the xposed framework modules HACK CONNECTIVITY SERVICE 1.4 or Fake Wifi Connection
BUT obviously since CM12 (Android 5.x) I have the same problem as you:
BUG/missing permissions? eth0 (USB->LAN) interface only usable as root user in terminal since CM12
When I try to ping my router ping 192.168.1.1 or any internet IP I get a android connect network is unreachable.
The only IP-adrress I can ping as normal user is my own IP-adress of the eth0 interface (for expample 192.168.1.XX).
After login as root with the su command in the terminal I can ping the router IP and every internet IP.
Even disabling the iptables filters/firewall did not help.
When I switch to the wlan0 interface I can ping everything with my normal user and the internet connection is available for every app.
My configuration:
S3 i9300, asix USB-LAN adapter, kernel: boeffla 4.0-alpha-11-CM12.1, cm-12.1-20150825-UNOFFICIAL-i9300.zip

Hello, any progress on the ethernet connectivity? Would any of the M or N roms support this?

Try this:
Hi
Have you tried this (for Lollipop):
Code:
ndc resolver setnetdns eth0 "" 8.8.8.8 8.8.4.4
I had the same problem as you and this solved the problem on Galaxy Note 4 with 5.1.1 (was able to ping 8.8.8.8 and 8.8.4.4 but not google.com. after typing this in the terminal, the ping worked !)
However, I am stuck at a step further: Even with this, it seems all apps do not recognize the internet connection through ethernet (no problem with WiFi).
I am pretty sure that it's not a matter of ConnectivityHackService or Fake Wifi (that I have installed by the way), since I have the problem for all the apps I was able to check (many).
Does anyone know how to solve this ?

Related

Motorola Milestone Ad-hoc wifi for the needed

After trying several methods (tiwlan.ini, wpa_supplicant.conf, wpa_supplicant patch) to get my Motorola Milestone to connect to my Laptop's Adhoc wifi network with no success, i finally come up with a solution. Now I am sharing it here hoping it will help those with the same problem.
The idea is to use Barnacle (on Market) to first setup a connection with the laptop, then re-config it to make the sharing work in the reverse direction.
Steps are as followed:
1. Start Barnacle (you may check "Local Mode" in Settings to go ahead without a data connection in phone), then connect your laptop to the wireless network it creates (named milestones or so). After this step, your phone's IP will be something like :192.168.5.1, and your Laptop's IP will be something like: 192.168.5.100
2. Start sharing your data connection from Laptop, in doing that, your Laptop's IP will be forcibly set to 192.168.0.1 (yours may be different, just note that this IP will be used as default gateway we use in the next step)
3. Now the configuration part:
//Start adb shell by entering at Cmd prompt
adb shell
$
su
#
//mannualy set IP for your phone, can be anything in form of 192.168.0.xxx
# ifconfig tiwlan0 192.168.0.2 netmask 255.255.255.0
//manually set the default gateway of the phone to the Laptop's IP at this time
# route add default gw 192.168.0.1 dev tiwlan0
After these steps, the phone can access the internet via the Laptop's connection. We will complete the remaining by manually specifying a DNS for the phone
# setprop net.dns1 #.#.#.# (here you should replace the #.#.#.# to a known IP address of your ISP's DNS, in worst case you may use Google's DNS)
//Now test with ping to see if we receive any response:
# ping -c 4 192.168.0.1 => the Laptop should answer
# ping -c 4 191.168.0.2 => phone are pinging itself, the phone should answer
# ping -c 4 209.85.175.106 => some server in the Internet should answer
# ping -c 4 www dot google dot com => Google should answer
If the tests above are all OK, you are done, enjoy the internet from your phone !
have tried :
+ Mail OK
+ Browser OK
+ Internet radio OK
+ Market nearly OK (in here the app browsing is OK, but download seem stuck)
Please confirm your result,
Codelavie
not working. i follow your guide exactly, but it didn't work. how can you do that? where am i wrong?
Didn't work for me either. After quite a hard experience I've managed to compile a wpa_supplicant with adhoc support for Milestone 2.1-update1 after applying szym's patch, and so far it works fine. The only thing you need to do is substituting the original system/bin/wpa_supplicant for the patched one, and restart wifi. I cant post the link yet because I'm new in the forums, but I'll post it as soon as i can.

Solution to Tethering + OpenVPN issues on KitKat/4.4

I was previously using a stock rooted Nexus 4 (with 4.3) with "OpenVPN Connect" (net.openvpn.openvpn) and android built-in wifi tethering to tunnel tethered clients through the OpenVPN connection. This required some iptables modifications but worked fine.
With a stock rooted Nexus 5 (with 4.4.0) and OpenVPN Connect 1.1.12, this stopped working and that was really annoying.
Part of the issue was the one described here
But it was more complicated. It seems that there are routing table issues that I had to research a bunch.
Here are the iptables commands that I already had to run even on the Nexus 4 (with 4.3), which I got from here
Code:
iptables -t filter -F FORWARD
iptables -t nat -F POSTROUTING
iptables -t filter -I FORWARD -j ACCEPT
iptables -t nat -I POSTROUTING -j MASQUERADE
These (above) are somewhat liberal firewall rules that you may what to refine for more security.
But below are additional routing entries that I needed to add specifically for the Nexus 5 (with 4.4.0). They force tethered clients to route through the VPN, unless their traffic is a broadcast or designated for the wifi LAN. Those exceptions are required for DHCP to work on the tethered client. They assume the tethered LAN is 192.168.43.XYZ and the OpenVPN interface is tun0.
Code:
ip rule add from 192.168.43.0/24 lookup 61
ip route add default dev tun0 scope link table 61
ip route add 192.168.43.0/24 dev wlan0 scope link table 61
ip route add broadcast 255.255.255.255 dev wlan0 scope link table 61
This seems to all work best if I start OpenVPN after activating tethering, not before.
I'm not entirely clear whether this is a result of some change/bug in KitKat, or an incompatibility in "OpenVPN Connect", or both. I wonder if it would work ok with other OpenVPN clients like "OpenVPN for Android" (de.blinkt.openvpn)
Other Notes:
* Server is OpenVPN 2.3.2
* Server has this line set in its config:
Code:
push "redirect-gateway autolocal def1"
Running android 4.4.2 google stock image with SuperSU on LG Nexus 4. These routing commands worked great and allowed me to tunnel all WiFi tethered traffic through my VPN. Thanks for figuring this out it was bugging me!
Im stock 4.4.2 no root or anything just pure stock i download install openvpn from google play and imported my config files click connect then open PDAnet connect and the Ip is changed.
OK, so I'm having a bit of trouble understanding and implementing the fix for my nexus 5. I've already got WiFi tethering working through the sqlite db fix but now I can't get my connection to work when my VPN (PIA official app) is broadcasting. These commands you're sending, are they done on the phone terminal or computer and is that EXACTLY how theyre being entered. For rules in red where would I find the IP I would use. Thanks guys Id really appreciate any help given.
Worked!
scootley said:
This seems to all work best if I start OpenVPN after activating tethering, not before.
Click to expand...
Click to collapse
Thanks scootley! These worked me on 4.3. I activated my hotspot before OpenVPN, but I used
Code:
iptables --flush
first before entering your commands. Seems to help. My OpenVPN server config also has the following in addition to push redirect:
Code:
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
push "redirect-gateway autolocal def1"
Jrock2t5 said:
OK, so I'm having a bit of trouble understanding and implementing the fix for my nexus 5. I've already got WiFi tethering working through the sqlite db fix but now I can't get my connection to work when my VPN (PIA official app) is broadcasting. These commands you're sending, are they done on the phone terminal or computer and is that EXACTLY how theyre being entered. For rules in red where would I find the IP I would use. Thanks guys Id really appreciate any help given.
Click to expand...
Click to collapse
These commands are entered on the phone. You can download Terminal Emulator or something similar through the app store.
First make sure you're connect to your hotspot from your computer. Next, let's find your local IP address. Here are the instructions for Windows:
Click on the Start menu and type cmd. When you see the cmd applications in Start menu panel, click it or just press enter.
A command line window will open. Type ipconfig and press enter.
You'll see a bunch of information, but the line you want to look for is "IPv4 Address." The number across from that text is your local IP address.
Here's how to do the same thing on a Mac:
Open System Preferences (via the Apple menu at the top lefthand corner of your screen).
When System Preferences opens, click on the icon labeled Network.
You should see a few options on the left with labels like Wi-Fi, Ethernet, Bluetooth, etc. The ones with green dots have IP addresses assigned to them. Click the one on top (if it isn't already selected) and look to the right. There should be a sentence that reads something like "Wi-Fi is connected to Chocolate and has the IP address 192.168.1.102." The number at the end of that sentence is your local IP address.
Thanks for this thread, I've nearly got tethering working through Private Internet Access/Open VPN.
When running the commands
Code:
ip rule add from 192.168.43.0/24 lookup 61
ip route add default dev tun0 scope link table 61
ip route add 192.168.43.0/24 dev wlan0 scope link table 61
ip route add broadcast 255.255.255.255 dev wlan0 scope link table 61
i get an error "RTNETLINK answers: File exists"
I tethered up while connected to the VPN and could ping out to external IP addresses but no DNS resolution. So in my windows settings I manually specified DNS settings and can now browse the web through the VPN on my Galaxy s4!
But how do I fix the DNS issue? I want the clients that connect to pick up the DNS settings that actually work, without having to manually specify.
Thanks for any help
Vpn problem
Hi I havent tried the above options..yet
I have a sgs3 sgh-t999 . a comercial vpn account with the xxx.ovpn cert files.
after getting the details entered into open vpn and importing the cert file all is good untill I go to connect [see attachment]
phone is v4.3, baseband mjc, kernel v 3.0.31, rom S3rx v3.0 1-27-14
any suggestions on how to proceed?
RXP said:
Thanks for this thread, I've nearly got tethering working through Private Internet Access/Open VPN.
When running the commands
Code:
ip rule add from 192.168.43.0/24 lookup 61
ip route add default dev tun0 scope link table 61
ip route add 192.168.43.0/24 dev wlan0 scope link table 61
ip route add broadcast 255.255.255.255 dev wlan0 scope link table 61
i get an error "RTNETLINK answers: File exists"
I tethered up while connected to the VPN and could ping out to external IP addresses but no DNS resolution. So in my windows settings I manually specified DNS settings and can now browse the web through the VPN on my Galaxy s4!
But how do I fix the DNS issue? I want the clients that connect to pick up the DNS settings that actually work, without having to manually specify.
Thanks for any help
Click to expand...
Click to collapse
1) RTNETLINK answers: File exists
This just means you already ran the command before during this reboot session and it's saved into the route table. If you restart your phone, and run the commands again, it will go through first time, but repeated commands will yield same error. Should be normal. Table clears on reboot.
2) Please see the thread at http://forum.xda-developers.com/galaxy-s2/help/solved-wifi-hotspot-issue-samsung-t1689242
It seems like in order for OpenVPN DNS push to work, you have to change your APN settings on your phone to have it automatically register and push out to your other devices. I had the same problem and came across this during a search.
Massive thanks to the OP for posting this here and to everyone helping out in this thread.
The above rules route wifi tethered traffic via the vpn but I was wondering if there are similar rules to route usb tether too?
Cheers
It seems to work once, but when Data connection is lost or openvpn reconnects, wifi tathering stops working, need to do everything again (switch all off, connect to 3G, vpn, create wifi hotspot and apply fix script). And somehow DNS doesn't work. Tryed on Galaxy S5, LG L70, both on 4.4.2
But in general, this workaround is working, just needs a little bit of tweaking
This is fantastic.
For those of you using VPN on your phone as well, does it seem to stay connected? My VPN (OpenVPN) was flawless on 4.3 ... I mean smooth as ice with no disconnects.
When I upgraded to Kitkat, I wanted to immediately hide in a hole from embarrassment. Only after trying to connect and stay connected did I start to read around to check what the heck was going on. Biggest mistake ever. But then again, who would have thought right? I mean come on...who would have thought it would make using VPN a nightmare after an update that's suppose to be improved? Whatever...
Anyhow, lesson learned. Now I'm waiting desperately for someone to figure out how to downgrade from 4.4 back to 4.3 and/or to find a patch/fix for this issue so we don't have to run a script on every boot or reset.
At the end of the day, at least there is a solution thanks to folks like you. Kudos to the OP and everyone else who has contributed to the work around...for the time being lets hope...
:good:
For anyone interested, I played with the commands to have it work over a USB tether instead of Wifi. Why? Because my battery life stinks and this way my phone is charging also. What the heck. works great.
The only change was in the two spots where it has "wlan0" change them to "usb0". Another change was that the subnet of the USB connection is 192.168.42.0/24 (versus 192.168.43.0/24 on wifi). I get it working in this order:
1) reboot phone (to make sure to other lingering route tables are wiped out
2) turn off wifi
3) establish VPN connection
4) start USB tethering (and have your phone usb connected to your computer
5) After eveything is hooked up, open a terminal window, make sure you have superuser access (su) and execute the commands below. I just have them saved in a text file on my phone's sd card, copy them and just paste them all at once into the terminal window. Haven't figured out how to get this to run automatically using init.d (yet - assuming you can because upon phone reboot, I have to assuming that it will spit out errors because the tun0 and usb0 devices will not exist!)
iptables -t filter -F FORWARD
iptables -t nat -F POSTROUTING
iptables -t filter -I FORWARD -j ACCEPT
iptables -t nat -I POSTROUTING -j MASQUERADE
ip rule add from 192.168.42.0/24 lookup 61
ip route add default dev tun0 scope link table 61
ip route add 192.168.42.0/24 dev usb0 scope link table 61
ip route add broadcast 255.255.255.255 dev usb0 scope link table 61
Vpn api delete route joy downgraded
@grogargh
Have you tried Tasker, run shell
To run after booting [or from widget or otherwise]
http://forum.xda-developers.com/showthread.php?t=1110775

Nexus 5 - Android L wifi tethering fix

Thanks to @buraktamturk here
Here is solution for tethering (both usb and wireless).
Tether just as usual. Then disable tethering and re-enable it. (this step is important otherwise dhcp server is not started)
After doing that both your phone and computer will not connect internet, because of invalid routing table. (internal bug from l preview)
just connect to the phone shell with 'adb shell', or terminal software on android (connectbot or android terminal emulator will fine)
Code:
[email protected]:/ $ su
[email protected]:/ # ip route | grep rmnet0 | grep link
10.64.70.120/29 dev rmnet0 proto kernel scope link src 10.64.70.124
Note the gateway here (10.64.70.124), and set this default gateway. (and yes, my provider gives me nat'ed private ip addresses)
Code:
[email protected]:/ # route add default gw 10.64.70.124 dev rmnet0
Enjoy the tethering!

USB OTG Ethernet Problem

Hello, I currently have my Galaxy J7 2016, Android 8.1 with Oxygen Kernel installed. I tried using an Ethernet Adapter and set it up manually through terminal.
Code:
su
ifconfig eth0 192.168.1.101 netmask 255.255.255.0
route add default gw 192.168.1.1 dev eth0
setprop net.eth0.dns1 1.1.1.1
setprop net.eth0.dns2 1.0.0.1
I can ping ip addresses in my network and gateway, 8.8.8.8 and even domains like google.com through Terminal.
But the problem is that it still has no internet when using all android apps.
I have Linux Deploy with Debian installed in phone, I can connect through PuTTY in Windows. I can download some stuff in Debian, but outside it has no internet connection.
What seems to be the problem? I can't figure it out because it works in my tablet Lenovo Tab 2 A7-30HC with no problem at all.

Ethernet partial working on Lenovo YT3-X50L

I have a (rooted) Lenovo Yoga Tablet 3 with Android 6.0.1 with broken RF interface (no Wifi, no Bluetooth...). So I tried to get up the Ethernet.
I used 3 different dongles, but no one was plug and play with this tablet (but all 3 work plug and play on other tablets...)
As it didn't come up with simply plug in, I managed the connection by adding (after plug in the dongle):
Code:
su
# as dhcpcd uses default table main and it isn't in the rules
ip rule add from all lookup main pref 1
# set up eth0 via dhcp
dhcpcd eth0
# here only ip addresses work, so for the dns I have to set the (android) resolver
ndc resolver setnetdns eth0 <MYROUTER> 8.8.8.8 8.8.4.4
Now all browsers and a ping app work fine, but messengers (Whatsapp, Telegram...) say 'no internet'.
When I connect via usb with gnirehtet everything works fine but I don't like to spend an extra PC for the reverese tethering server. So I changed the usb cable with the ethernet dongle and everything works fine until I stop the VPN left open. Ifconfig shows me that there are no packeges routet via tun0, just via eth0. Unfortunally I couldn't get up another VPN setup as all clients tried (even the android built in VPN) showed up 'no internet'.
So, has anybody an idea what I can do without the gnirehtet workaround?

Categories

Resources