yashsingh1/xdaforums huggingface dataset:
[Networking] itsmepawan:
Thanks [MENTION=4643647]toppits[/MENTION] I got it working on Android 5.0.2, but since i haven't followed wifi step, i am not getting 100% internet across all the app. Just surfing thats it.(isn't any other way around?) :)

[MENTION=6190600]class101[/MENTION] Thanks a ton for the scripts.. :good: but isn't it possoble without wifi, because i dont have one. If it's possible with 3g or something that would be great. And also waiting for the progress on BRIDGE. Good luck !!
[Networking] class101:
[MENTION=4643647]toppits[/MENTION] the right command is rn only, and I think for you it is not known because you did not reboot Android, once you reboot Android you should have access to the new alias

Nor it is a reboot problem, nor you forgot to place that file in /etc/mkshrc

[MENTION=5435006]itsmepawan[/MENTION] This is what I'm looking for too at work I don't have any wifi to connect to like you, I miss the trick to fake the wifi under Android 5.0. I've some programming knowledge and willing to code it but I'm not even sure it is possible to code an App faking the wifi adapter without the Xposed requirement,

As far I have tested about 3G, nope not possible to just enable rmnet0, you can try rm.sh it is supposed to bring the 3G adapter in the network but it does not bring anything better, I think we have no other choice than faking a Wifi because many applications are configured to be in a "limited" internet mode if using 3G instead of Wifi

Someone has an idea why the Fake Wifi Connection App for Android 4 depends on Xposed, is it really not possible to design an App for faking a Wifi without Xposed ??? (Xposed being not supported in Android 5)

//edit:np for the guide I will let you know once it is over, ideally I would like to find a better method for faking the Wifi than spoofing the address of the real wifi adapter in the bridged or connection shared network because as you see the limitation is that when there is no wifi access point, it is very limited to the use of chrome, speedtest.net and very few others apps, I think I will try to read the source of Xposed and FakeWifi together to see if it is possible to join the parts of Xposed we need + fake wifi in a single apps supporting android 5.x

//edit2: Looks like FakeWifi uses a big feature of xposed that is system wide function hooking, it intercept and changes system calls on the fly so it is not just using a small feature of xposed :(
[Networking] ptj666:
how to get around capped tethering

Hi.

Thanks for the useful information. But I have a different problem. with the new contract 3 uk has capped tethering to 2 GB only.

I would be grateful if you could instruct me how to get around the capped tethering.

Best regards.

ptj
[Networking] toppits:
As I wrote, all alias without a path in it (like n, pi, ...) work without a problem. Just the ones with a path (like rn, wl, ...) give me an error. But if I type it without the alias it works. :confused:
[Networking] class101:
Ho, hmm, sounds like character problem, did you use vi to edit the mkshrc file ? if not try opening it with vi /etc/mkshrc sometimes it reveals extra characters a possible other editor has placed, once you are in vi, you have to press i to enter the insert mode to enter characters, esc(vol up + e in terminal) to leave insert mode and :wq to save the file
[Networking] toppits:
thx! it works now. I'm not sure what exactly did the trick but it works :)

I did use another app to edit the file before. After your post I first installed busybox, then opened the file with vi and deleted the rn line and wrote it new and saved the file. Now i didn't get any error but I had no output (echo..) when I used rn. With rnoff and the others I did get an output so I restarted and now it works as expected. I'm still puzzled but at least it's working now :D thx again :)
[Networking] ahhl:
if someone can create app for this would be nice...:D:o

one click we all get connected...:p
[Networking] SpEcHiDe:
Reply to your POST

It won't leave a trace on your WiFi router.

The Windows version of this tool can be developed . But my suggestion is to use the existing tools and not to re-invent the wheel.

Using Xposed Installer has a lot of issues

1. They do not reveal the source code and hence we do not know what malicious action is done by that app.

To solve play store issue just switch on your wifi without connecting to internet. Play store will be fooled.

If you know a way of turning on usb tethering by adb please PM me . Your reply would be appreciated. As of now I donot know about such a feature.
[Networking] stras1234:
thanks to Stackoverflow: http://stackoverflow.com/questions/...android-device-using-adb-through-the-terminal

i have tested this and works on my phone: adb shell su -c service call connectivity 34 i32 1
[Networking] class101:
As far I'm checking right now on Lollipop, the Fake Wifi method people is using under 4.4 with xposed does not seem worth to implement, even if we had a working hook library for it supporting 5.0, this is so dirty to implement, for example it hooks so much functions, like when an app request for network infos, it is sending a fake network infos, etc etc

Exactly it hooks isWifiEnabled() getWifiState() getConnectionInfo() getDhcpInfo() getActiveNetworkInfo() getActiveNetworkInfoForUid(UNDOCUMENTED) getProvisioningOrActiveNetworkInfo()	(UNDOCUMENTED) getActiveNetworkInfoUnfiltered() (UNDOCUMENTED) getNetworkInfo( int ) getAllNetworkInfo() isActiveNetworkMetered() requestRouteToHost() getActiveLinkProperties() (UNDOCUMENTED) getLinkProperties( int )

And deal with all the possible issues it brings, for me that method is a no go !

Instead I'm looking in Java's reflection, it seems powerful, with a small app I have been able to build one that once installed in /system/priv-app + android.permission.CONNECTIVITY_INTERNAL granted, you can access all internal network functions we are not supposed to reach because they are private, but reflection works around very fine.

I'm sure there is a much simpler workaround to find that way like renaming an interface or why not setting up a new network device, reflection gives access to so much android internals, if you are willing to find a lollipop fake wifi solution with reflection let me know I can share with you a code snippet so you can start hunting with me! :highfive:
[Networking] tichs:
Wifi

To Spoof wifi do you have to be only connected to your home's AP or just Turn on wifi and connect to a Fake AP created by the script?
[Networking] class101:
The script does not create a Fake AP ?

To clarify

The script does nothing much than enabling usb tether, set ip, gateway and dns informations on the rndis0 interface and runs dnsmasq

After this started, you should have internet access in a few applications like Google Chrome, SpeedTest.net and newest Play Store app should work fine too, it works here on 5.0.1 and after a Play Store update

But the largest part of the Application like Google News, Ok google, etc..., won't recognize the internet over rndis until the Wifi interface responds running + connected to an access point

So currently if you really want all the Apps without exception to recognize the internet over rndis, in Android 5.0 you have to spoof the wifi card on a real Wifi access point, under Android 4.4.4 the same trick works but with Xposed + FakeWifi you should be able to enable the Wifi card and fake it as connected without it being really connected to an existing access point.

tip: If you use a Bridge instead of ICS, it is probably safer to set a fake gateway (a non existing ip as gateway route) on the Wifi interface, I do this here as an additional security to ensure only the rndis interface is able to bring the internet because under a Bridge you have the rndis and wlan interfaces in your real home network and if you set the gateway to your real internet box and then stop the rndis interface, you might switch to the internet over Wifi without noticing, with a fake gateway on the wifi interface, when you stop the rndis interface you don't have anymore access to the internet.
[Networking] tichs:
Ok, So It doesn't create anything fake. Cool
[Networking] class101:
I have asked this question as a Feature Request to Google developers here

USB Reverse Tethering: Isn't it possible to support it as a full network type as Wifi is ?

They have added some cc to google developers, at least they did not instantly rejected it so it might be possible that one day, we get a full internet access right after loading the script setting up the rndis0 interface.

Think to Star the feature to follow it, Starring it should also add some weight to the feature request, ideally anyone who replied to that thread should Star it because it is obvious you don't wan't to depend on Xposed/FakeWifi App, Wifi spoofing or similar other technic to just get the internet over rndis to work in 100% of the Android Apps.
[Networking] Dinesh Raja:
Need some help regarding Reverse Tethering in Ubuntu-14.04

Hi Everyone,

Someone kindly read this post and help me to do reverse tethering in my mobile from my Ubuntu PC Internet.
[Networking] FredP38:
Works well but...

Hello,

Thanks a lot for your new method. It works quite well.

I still have a issue. I have installed Sms Gateway on the mobile. I'd like to sent the app http commands to send sms with my Home automation system. I tried many different ways but nothing works.

It works well when the mobile is on Wifi mode but not with Reverse Tethering.

How to connected to the phone via ip addess and port ?

Thanks Community for your hep !
[Networking] class101:
Can't help you man, I'm not using linux as workstation

Most likely the same reason reverse tethering don't works yet in most situation, because Reverse Tethering in the Android code is not taken as a Network Type as Wifi is and so on, applications using the Android API to connect won't find the reverse tether connection, only few apps are able to detect it because to conne"ct they don't use the Android APi but some other functions aty the OS level, like Google Chrome, SPeedtest.net, Google Play Store App

Currently for the reverse tether connection to be detected as a internet access point in all apps, you have to spoof the Wifi card inside the reverse tether network under Android 5, nor if using Android 4 you might be able to fake a wifi access point with Xposed and FakeWifi module, spoofing Wifi under 4 also works but I'm not going to explain again how to do Wifi spoofing I already wrote it multiple times

I have asked to google to support Reverse tether as a full network type so as soon as we get an internet access with the RNDIS interface, every apps should see the connection, the google ticket is here if you need to follow any possible advance on this feature https://code.google.com/p/android/issues/detail?id=99034
[Networking] kallsop:
Windows: "Allow other network users to connect through...", then select the USB connection in dropdown list below."

Windows 7 Enterprise user here, there is no dropdown list. Anyway, went ahead and enabled sharing.

The 'Remote NDIS based Internet sharing Device' now shows that it has Internet connection, so that's good.

Phone (rooted): open terminal:

"su"

From "busybox ifconfig", the interface is usb0

"netcfg usb0 dhcp"

This hangs for a minute or so, then returns with no messages. Apparently, no internet over USB though, can't browse any web sites. Then a few minutes later, the 'Remote NDIS based Internet sharing Device' lost its internet connection.

This is a Oppo Find 5 phone running the latest official cyanogenmod 11 Stable. What to try? My objective is to use the USB reverse connection to use the phones SIP dialer to make international voice calls.
[Networking] K.MED:
Hi, I stuck in the very first step.

"then select the USB connection in dropdown list below."

I have no USB connection in the list, just Ethernet and LAN.

What should I do?

windows 8.1 pro 64

PC is connected via wifi for now, no LAN avilable
[Networking] trulex:
DNS does not work when I do this on my LG D605 with CM11. I tried setting it with DNSSetter. I can ping IPs, but not hostnames. Any ideas?
[Networking] praclika:
My solution

I had some problem with outer network. I could only reach my laptop from my phone but nothing else. It was not DNS problem. I couldn't ping for example my LAN network's IPs, except my PC (with not it's LAN IP).

I could solve this problem. I do not guarantee that work in all cases. My phone is Android 4.4.2 device and I use Arch Linux on my PC, so my description can work only for Linux PC. You have to install dnsmasq on your PC.

Probably the phone's side commands can work with Windows PC with other gateway IP address.

1. Plug the phone into your PC. Turn on USB internet mode (Windows PC internet..., not simple USB tethering option; I choosed Windows 8 from this menu, but I think it is not important.)

2. Open a terminal in your PC

3. ip a

This command will list devices.

In this example the phone is "enp", and the pc device (ethernet or wlan card) is "wlp".

You have to change in this commands "wlp" and "enp" to your devices!

I suppose you have Internet access on "wlp" device.

4. sudo ip link set enp up

5. sudo ip addr add 192.168.123.100/24 dev enp

6. sudo su

7. echo 1 > /proc/sys/net/ipv4/ip_forward

8. If you don't have dnsmasq, install it!

Write this into /etc/dnsmasq.conf file (You have to change "interface=enp" to "interface=your_android_device"! You can edit /etc/dnsmasq.conf file for example with this command: "nano /etc/dnsmasq.conf", Save: Ctrl+O, Exit: Ctrl+X):

domain-needed

bogus-priv

interface=enp # change to your interface

dhcp-range=192.168.123.101,192.168.123.200,12h

9. systemctl start dnsmasq

If you don't have systemd, you can use this command: "dnsmasq"

10. iptables -t nat -F

11. iptables -t nat -A POSTROUTING -j MASQUERADE

After it on your phone:

1. Open a Terminal Emulator

2. su

3. You can list devices with "ip a". The device name is not the same as in your PC. In this example it is rndis0

4. ip addr flush dev rndis0

5. dhcpcd rndis0

6. ping -c 3 192.168.123.100

This command ping your PC 3 times. It's a test. If you do everything well, it will work.

7. ping -c 3 google.com

Wait some seconds.

If you can ping Google, you are done.

If not (for example you get unknown host message), do this:

8. ip route add default via 192.168.123.100

9. ping -c 3 google.com

Wait some seconds.

If it doesn't work try to edit this file on your phone: /system/etc/resolv.conf

You have to put this into this file:

nameserver 192.168.123.100

You can find a description about how to do this on this site.

I hope I could help.

If it doesn't work, try to unplug your phone, restart your computer and your phone and after it, try to repeat this from beginning.
[Networking] trulex:
Thank you so much! Adding file resolv.conf fixed the DNS problem.
[Networking] RudeBwoy:
Does this work on linux?
[Networking] praclika:
Yes. But your phone displays only some Windows versions, because it should have different settings with different Windows versions. When you choose one of them, it set the device IP, gateway IP, DNS server IP on your phone for the specific Windows version.

Only you have to do is configuring your Linux PC to serve your phone. You have to add the gateway IP to the device, setup a DNS server with this IP, a nat and enable forwarding. Take care about which Windows version you choose! You have to do this configuration with the correct gateway IP, which depends on which version you choose. You have to setup the DNS server with the same IP as the gateway has. First you have to install dnsmasq (this is the DNS server software), if you don't have.
[Networking] oleksandr_at_home:
Android 5.0

Hello ,

Thanks for posting this. I have checked this solution on MotoG Android 5.0 (rooted) with busybox installed

the problem is that even if you configure rndis0 interface, applications on android talk to ConnectivityManager and if it is not cellular or Wi-Fi connection type - apps treat any other connection type as no internet connection.

Trick with 3G doesn't work (after some time rmnet0 interface refreshes with IP) and in most cases you have access over to cellular internet but you do not want to use it. Ping to Google from Terminal Emulator works but nothing else :(
[Networking] class101:
As a reminder, a ticket exists about the Wifi requirement over rndis0 enabled https://code.google.com/p/android/issues/detail?id=99034

Star it to follow and support, let's hope they are cooking us something, haven't checked the source yet to see if any special branch/tag as started about that
[Networking] ehsan_zt:
Thank you it works.

I had problem with viber,... and the last command did not work for me. Instead, I used a xposed module called Fake Wifi Connection, and from its interface selected viber and saved, now viber works too :D
[Networking] BertHodge:
On my Android 2.3.4 I did these steps with mobile data enabled:

ifconfig usb0 192.168.137.2 netmask 255.255.255.0
route add default gw 192.168.137.1 dev usb0
ifconfig rmnet0 0.0.0.0
setprop net.dns1 192.168.137.1

net.dns1 alsways got changed back to the DNS address of the mobile data connection. The result was:

getprop net.dns1
193.189.244.206
ping -c 1 google.de
ping: unknown host google.de

Then I added

setprop net.rmnet0.dns1 192.168.137.1

Now it works.

Is there another method to use the PC as DNS. I'd prefer not to change

net.rmnet0.dns1

?
[Networking] class101:
Changing this does not make your PC as DNS, it instructs the rmnet0 interface where to send the packets when it receive a domain name resolve request, to make a pc a real dns server you need to install a software like bind9 on Linux, or to enable a specific Windows component but I doubt it is what you are looking for you do not need to set a dns server for reverse tethering.

Anyway for known methods for changing the dns server ip in android you can look at the script I'm linking to, I'm not sure what is available under you android 2, but in 5 the effective line setting the dns forward are sets on the process dnsmasq I'm loading with the appropriate network settings, because this is the only place I have found where that dns setting was read, none of the net.*.dns? worked here.
[Networking] jojoledemago:
Thank You Class101 !

Thank you very much Class101 for sharing those informations !

Your script is the first mean I find to charge my nexus 5 on android 5.1 while I'm connected to the Internet without wifi nor 3G access ! :)

Still two little problems :

1. Battery decreases faster than it charges from USB port...

2. alias doesn't work for the moment but maybe because my phone closed with no battery... it worked first but after reboot, it didnn't anymore...

For the moment, I only need rn.sh tu run the app I wanted to run so don't need more but I voted for your request on android new features as well.

Sorry for my english, I'm french...

Thank you again ;)
[Networking] :
Wow, need to try that, thanks!
[Networking] jojoledemago:
problem with alias...

Hi !

Still got a problem with alias, I follow the steps but each time I reboot, alias don't stay recorded... Here is what I do :

su
mount -o remount, RW /system
alias rn='sh /sdcard/rn.sh'
alias rnoff='sh /sdcard/rnoff.sh'

What am I doing wrong please ?
[Networking] subkpatel:
help

please make a video tutorial.:)
[Networking] mithundperfect:
+1
[Networking] jojoledemago:
auto answer... ;)

I found where I was wrong, here is what I finally did :

su
mount -o remount, RW /system
vi /etc/mkshrc

Here you can edit mkshrc file, read this link if you are a noob with Busybox as I am... : search in google "k.japko.eu busybox vi tutorial" (sorry I can't post links before 10 posts on xda... :( )

Maybe there are some best tutorials fot a use with an android keyboard but I only read that from class101

That was enought to manage to edit the file and save it...

I added th alias lines juste above the last line where it's written "add your personnal code above this line"

alias rn='sh /sdcard/rn.sh'
alias rnoff='sh /sdcard/rnoff.sh'

then registered the file with ":wq" then Enter

And now my aliases work !!!

Thank you again class101 !!! :good:
[Networking] ujilraj:
I'm on CM based 5.1.1 Rom, the shell scripts seems fine & gives me internet connection in browser, but i'm unable to create a working wifi static ip on my phone... So, i cant connect to playstore... Is there any method to create a fake wifi connection OR is there a way to connect playstore to internet without wifi???

BTW, i'm using YU YUREKA with CM 12.1 based ROM.
[Networking] El-Chupacake:
So we need a WiFi hotspot to tether in lollipop?
[Networking] ujilraj:
I enabled the net connection by the scripts & got coonection on my phone... Then, i tried to connect to a wifi hotspot created from my other mobile which lacks internet connection... Though i can send files between the phones, my yureka phone doesn't give access to playstore as it shows no wifi internet connection available screen, but whatsaap & few other apps shows net connection all this time...

Basically, a static wifi ip needs to be set which should fake a wifi connection, but somehow it's not working in LP 5.1.1 based Roms (it worked fine in stock KK roms)
[Networking] sushantxda:
please help

05-18 12:42:13:560 W/I Tool version : 3.19

05-18 12:42:13:560 W/I adb.exe

05-18 12:42:13:560 W/I aapt.exe

05-18 12:42:13:697 W/I Android Debug Bridge version 1.0.31

05-18 12:42:15.07 A/W process (5700) : Implicit intents with startService are not safe: Intent { act=service.tracetool.SocketService.ACTION (has extras) } android.content.ContextWrapper.startService:507 android.content.ContextWrapper.startService:507 service.tracetool.TTBroadcastReceiver.onReceive:41

05-18 12:42:15.13 A/I UsbThread3 : usbServerSocket : Waiting for the host to connect

05-18 12:42:17:051 W/I Wait java service

05-18 12:42:17:155 W/I waiting android server connection ... 1

05-18 12:42:17:359 W/I Waiting for connection

05-18 12:42:18:665 W/I Sending busybox21

05-18 12:42:17.17 A/E UsbThread3.run() loop error. firstByte : 39 : WTOA_copyFile

05-18 12:42:17.17 A/E UsbThread3.run() loop error. lastCommand : 32 : WTOA_setGlobalVar

05-18 12:42:17.17 A/E UsbThread3.run() loop error. Exception type : class java.io.FileNotFoundException

05-18 12:42:17.17 A/E UsbThread3.run() loop error. Exception message : /storage/emulated/0/busybox21: open failed: EACCES (Permission denied)

05-18 12:42:17.18 A/E UsbThread3.run() loop error. Exception cause : libcore.io.ErrnoException: open failed: EACCES (Permission denied)

05-18 12:42:17.18 A/E UsbThread3.run() loop error. Exception string : java.io.FileNotFoundException: /storage/emulated/0/busybox21: open failed: EACCES (Permission denied)

05-18 12:42:17.18 A/E libcore.io.IoBridge.open(IoBridge.java:409)

05-18 12:42:17.18 A/E java.io.FileInputStream.<init>(FileInputStream.java:78)

05-18 12:42:17.18 A/E service.tracetool.Api.copy(Api.java:1471)

05-18 12:42:17.18 A/E service.tracetool.UsbThread.copyFile(UsbThread.java:1944)

05-18 12:42:17.18 A/E service.tracetool.UsbThread.run(UsbThread.java:316)

05-18 12:42:17.18 A/E UsbThread3.run() -> unexpected disconnection

05-18 12:42:17.18 A/I UsbThread3 : usbServerSocket : Waiting for the host to connect

Server List at 05-18 12:42:47:620

DNS List

202.88.131.90 (ok)

202.88.131.89 (ok)

8.8.8.8 (ok)[default]
[Networking] tichs:
Despite of this being so easy people have a lot of issues.

If you really want the reverse tether and like your wired speed get one of these, It'll save you time and everything just works;

Micro-usb to Ethernet connector;

http://goo.gl/PKT97D

If you can afford the phone that you have you can definitely afford that.

***********************

If you have the microusb alone make sure you have the proper deice drivers, and you can tether your phone, also make sure that you connect to your home's wifi. But really, this reverse tethering it's kind of useless if you have the adapter handy.
[Networking] ujilraj:
Quick update: I tried Hack Connectivity Service v1.4.apk along with reverse tether scripts on my LP 5.1.1 based rom & is able to get playstore & google maps working & i'm able download apps (using the wifi hack). Still not as perfect as fake wifi, but hey, something is better than nothing, rite :)