Tethering via WiFi - Troubleshooting

Search This thread

honestabe

Senior Member
Dec 5, 2006
104
0
New York
im new to tmobile.. with att there was a tethering plan and if they found out you were tethering without the plan they would A. attatch it to your plan or B. make you pay for the data you used..

is this not the case with tmobile.. i can do this without the worry of being charged?
 

jashsu

Senior Member
Nov 15, 2008
1,849
20
im new to tmobile.. with att there was a tethering plan and if they found out you were tethering without the plan they would A. attatch it to your plan or B. make you pay for the data you used..

is this not the case with tmobile.. i can do this without the worry of being charged?

Supposedly tethering is not supported for unlimited dataplans for smartphones. They do have separate internet plans (for 3g usb dongles). The feeling is that they will throttle but not bump you up to the full internet plan.

I hope not, anyway. Used crazy amounts of data over tether during CES. :p
 

parrothd

Senior Member
Nov 10, 2008
189
3
From what I've read,

tmobile doesn't have a tethering plan for the g1, and as long as you stay under the bandwidth cap of 5gigs(???) you shouldn't have any issues.

If you go over the bandwidth cap tmobile will downgrade your data speeds to edge speeds until the next month.

Not sure how tmobile would be able to tell if you're tethering or using the phone. They could see what browser type you're using but you can change that and they'd have no way of knowing, IPtables is basically doing a NAT with the phone so your tethered device is hidden..
 
Last edited:

momentarylapseofreason

Senior Member
Apr 29, 2007
1,073
18
Chicago
I think you should clear up where to put the files. If you put them in a new folder called C:\tether, you cannot run adb from that directory unless you copy it over as you will get an error "ADB is not recognized as an internal or external command"
 

jasoncheng

Member
Nov 29, 2008
21
0
is there is possible to

1. get the numbers who currently use G1 tether form log or command
2. can i add [dhcp-host=MAC,IP] dymanic , after i run [tether start]

ps. i wanna to create app for everyone, let user can easy start tether and block some connection user
 

smooththg69

Member
Nov 2, 2007
13
0
Guess I'm stupid with the command but every time I use the push command it says
Directory doesent exsist. Any help ?
 

jashsu

Senior Member
Nov 15, 2008
1,849
20
I think you should clear up where to put the files. If you put them in a new folder called C:\tether, you cannot run adb from that directory unless you copy it over as you will get an error "ADB is not recognized as an internal or external command"

Everyone should put the adb location in the environment path. That's part of the sdk installation instructions.

Edit: btw the dnsmasq.conf-secure file is misnamed as "dsnmasq... Folks who will use that file (btw "secure" is debatable) should rename it to the proper name. ;)
 

jashsu

Senior Member
Nov 15, 2008
1,849
20
Not sure how tmobile would be able to tell if you're tethering or using the phone. They could see what browser type you're using but you can change that and they'd have no way of knowing, IPtables is basically doing a NAT with the phone so your tethered device is hidden..

Deep packet inspection and traffic profiling could probably catch tethering. I don't think it's so much the act of tethering but rather the amount and frequency of data consumption.
 

parrothd

Senior Member
Nov 10, 2008
189
3
Everyone should put the adb location in the environment path. That's part of the sdk installation instructions.

Edit: btw the dnsmasq.conf-secure file is misnamed as "dsnmasq... Folks who will use that file (btw "secure" is debatable) should rename it to the proper name. ;)

Fixed, thanks...secure, as in only me having access (most users won't be able to connect and figure out why)..
 

jashsu

Senior Member
Nov 15, 2008
1,849
20
one other problem just noticed... change this line

chmod 755 /data/local/bin/dnsmasq to chmod 755 /data/local/bin/dnsmasq.conf

There is no need to chmod conf file. dnsmasq is an executable binary and it should be chmod 755 (along with the rest of /data/local/bin)

Fixed, thanks...secure, as in only me having access (most users won't be able to connect and figure out why)..

Yeah I was referring more to the risk of having the packets snorted out of the air. It's no a problem for me because I vpn into my corporate network. Make sure you are using SSL (HTTPS) for any sensitive websites.
 

daproy

Senior Member
Dec 3, 2008
166
1
Works great!

Just curious, tether-secure script is supposed to contain a different set of iptables? Looks the same as the tether script on my end? What am I missing?
 

momentarylapseofreason

Senior Member
Apr 29, 2007
1,073
18
Chicago
This is what I am getting at the point of "tether start":

insmod: init_module '/system/lib/modules/wlan.ko' failed (Operation Not Permitted)

fatal error opening "/sys/android_power/aquire_partial_wake_lock"

error : SI0CSIFADOR (permission denied)
error: SI0CSIFFLAGS (permission denied)

Could not open socket to kernal: Operation not permitted (X5)

/data/local/bin/tether: cannot create /proc/sys/net/ipw4/ip_forward: permission denied

dnsmasq: cannot open or create lease file /data/local/dnsmasq.leases: Permission denied.


What did I forget???
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    FYI,

    I've been able to successfully use iptables to configure ip masquerading (NAT). With it, I am tethered over WiFi without using tetherbot (which still works as a backup). Hopefully someone else can package this to be more useful.
    Update: See posts #13 and #15 on how to use Ad-hoc mode.

    • Root required
    • Existing wifi network required (and configured)

    1> Disable WiFi through the UI. Then turn on Wifi manually using the following commands as root. Normally the phone data interface and WiFi can't be turned on at the same time. (Can this be done through the android gui somehow?)

    insmod /system/lib/modules/wlan.ko

    wlan_loader -f /system/etc/wifi/Fw1251r1c.bin -e /proc/calibration -i /system/etc/wifi/tiwlan.ini

    cd /data/local/tmp
    wpa_supplicant -f -Dtiwlan0 -itiwlan0 -c/data/misc/wifi/wpa_supplicant.conf &

    sleep 5
    ifconfig tiwlan0 192.168.2.30 netmask 255.255.255.0
    ifconfig tiwlan0 up

    Note that I had to use a static ip since dhcp will typically add in a gateway.

    2> Enable and configure ip forwarding

    iptables -I FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
    iptables -I FORWARD -s 192.168.2.0/24 -j ACCEPT
    iptables -P FORWARD DROP

    iptables -t nat -I POSTROUTING -s 192.168.2.0/24 -j MASQUERADE

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

    3> On your computers, set your default gateway to your phone's WiFi IP address (192.168.2.30 - in my case). Also set your DNS to a real DNS server.

    Attached is the iptables binary, compiled with the android sdk.
    1
    You could I guess...

    Honestly it may be easier to just use adb to run the shell scripts that enable/disable the configuration.

    Hm, I've got it starting up from Terminal Emulator (Term.apk). I still have to type things on the command-line but at least I can start it up from my phone. First, I created this shell script to make it easier (which I named "tether" and stuck in /data/bin/):

    Code:
    #!/system/bin/sh
    
    case "$1" in
    'start')
    insmod /system/lib/modules/wlan.ko
    wlan_loader -f /system/etc/wifi/Fw1251r1c.bin -e /proc/calibration -i /data/local/tiwlan.ini
    ifconfig tiwlan0 192.168.2.1 netmask 255.255.255.0
    ifconfig tiwlan0 up 
    /data/local/bin/iptables -F
    /data/local/bin/iptables -I FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
    /data/local/bin/iptables -I FORWARD -s 192.168.2.0/24 -j ACCEPT
    /data/local/bin/iptables -P FORWARD DROP
    /data/local/bin/iptables -t nat -I POSTROUTING -s 192.168.2.0/24 -j MASQUERADE
    echo 1 > /proc/sys/net/ipv4/ip_forward 
    /data/local/bin/dnsmasq -x /data/local/dnsmasq.pid
    ;;
    'stop')
    rmmod wlan
    kill -9 `cat /data/local/dnsmasq.pid`
    /data/local/bin/iptables -F
    echo 0 > /proc/sys/net/ipv4/ip_forward
    ;;
    *)
    echo "Usage: $0 [start|stop]"
    ;;
    esac

    Then, I started up Terminal Emulator and called my 'suroot' binary (sh with setuid root). I tried calling 'tether start' directly but it was giving me permission denied errors. Then, I did this, which worked:

    Code:
    /data/local/bin/tether start | suroot

    Don't ask my why that works when calling it directly while in a shell via suroot does not work. In order to make it easier for myself, I put the above command into a 1-line shell script called "tetherup" which I placed in my /system/bin/ directory (because it's in my path). The net result is that via Terminal Emulator I can do the following to start up my tether:

    Code:
    # suroot
    # tetherup
    1
    I am on Windows Xp and that guide is what I was trying, but it does works with 2 PCs;
    the adhoc connection is working but the G1 does not show or connect it.
    I am on Haykuro 6.0r1
    It is strange that the applicazione WIFIScanner can catch my PCADSL adhoc but the G1 wifi Settings page does not show it even if I Add it with the Wi-Fi network options.
    The two images shows the WifiScanner application and the Wifi Setting page.
    Any Help?

    Hi. I have the same situation but I am using the app "Wifi Analyzer". Could anybody tell me if following the instructions in #13 we can connect the phone to the computer with the Ad-Hoc mode to use my broadband in my Gphone.

    Thanks.