Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,740,354 Members 44,538 Now Online
XDA Developers Android and Mobile Development Forum

WiFi Tethering on Android L!

Tip us?
 
r3ferrei
Old
#11  
Senior Member
Thanks Meter 16
Posts: 160
Join Date: Sep 2008
Location: Toronto
buraktamturk has discovered a solution to tethering on L:

http://forum.xda-developers.com/show...postcount=3041

Quote:
Lightbulb Tethering Fix
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:
shell@hammerhead:/ $ su
root@hammerhead:/ # 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:
root@hammerhead:/ # route add default gw 10.64.70.124 dev rmnet0
Enjoy the tethering!

Note your phone must be rooted otherwise you will not able to pass beyond 'su' command.
I packaged up the following in a sh script that gets run with Tasker when enabling tethering (I use it for my Nexus 7 in my car):

Code:
Select Code
#!/bin/sh
ip=$(ip route | grep mnet0 | grep link | sed 's/.*src //')
route add default gw ${ip} dev rmnet0
I saved the above in /sdcard/gateway.sh

I then run a command in Tasker:

Code:
Select Code
/system/bin/sh /sdcard/gateway.sh
I "think" this is working. Since I ran it manually, the IP is now stored in the routing table. If the IP switches and tethering suddenly stops working, ill know it's not functioning anymore and will tweak the script.
 
Angel0fDeath
Old
#12  
Angel0fDeath's Avatar
Senior Member - OP
Thanks Meter 96
Posts: 200
Join Date: Aug 2013
Location: Oklahoma City
Quote:
Originally Posted by jaron7_11 View Post
Working for me... One more q do you know if this counts data.. Meaning towards the 5gb teather on the plan

Sent from my Nexus 5 using XDA Free mobile app
It hasn't for me.
Hit the thanks button if I helped

Phone: LG Google Nexus 5 (32 GB)
Rom: Nexus 5 Experience Roml
Tablet: Rooted Amazon Kindle Fire HDX 7"

"I'd rather be hated for who I am than loved for who I am not." ~ Kurt Cobain
“You laugh at me because I am different; I laugh because you are all the same.” ~ Daniel Knode
”Nothing is impossible, the word itself says ‘I’m possible’!” ~Audrey Hepburn
"I don't insult, I diagnose."
Device Timeline:
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


XDA PORTAL POSTS

Control Your Toast Notifications with SlicedToasts

Toasts are delicious, even in their Android flavor. In Android, toast doesn’t lead … more

Rotation Lets You Take Full Control of Your Device’s Orientation Settings

To be brutally honest, the native options for screen … more

Change the Alarm Icon in the Status Bar with Xposed

It’s hard to find a more hated object than your alarm clock. They wake us up nearly … more

Return to Outer Space Outer Space with Ship Up Game

Since the release of Flappy Birds, we’ve had the “fortune” to see … more