• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root [MetroPCS] [Tether] Simple tether script for root users

ccaapton

Newbie
I wrote two simple scripts for tethering on our LG F6. "tether.sh" will start the tether, while "untether.sh" will stop it. Both need to be run by root.

You need to modify tether.sh and add your own SSID and password.

I recommend the "script manager" to manage and fast access the scripts.

It is definitely not as powerful as other GUI apps, but the scripts are simple and flexible enough so you can play with it, add or remove whatever stuff. Enjoy:D
 

Attachments

So when you tether with this method T-Mobile doesn't know? I will test it on Angablade's CM11 V9 Rom and let you know what happens...
 
Does not work on Angablade's CM11 V9 Rom.

"Error connecting (Permission Denied)"
"Failed to connect to hostapd - wpa_ctrl_open: Permission Denied"

Ran as root. Anyone else tried this on CM11?
 
Same thing on Xperion rom and stock 12b. Are you sure you got this to work?? lmao
Why don't you run the commands in tether.sh line by line in adb or smanager, then tell me which line cause such error?

If you are running tether.sh as a whole, do with with
sh tether.sh
. This is because of the "noexec/nosuid" property on sdcard partition.
 
When executing as root this is the output error.

stderr:
Failed to connect to hostapd-wpa_ctrl_open: no such file or directory
 
F6 running b12 on MetroPCS. I can connect to the AP but no internet access. Screenshot attached. I receive the same ERROR when running the script in terminal as root.

h**p://imgur.com/RLlbE0P
 
F6 running b12 on MetroPCS. I can connect to the AP but no internet access. Screenshot attached. I receive the same ERROR when running the script in terminal as root.

h**p://imgur.com/RLlbE0P

You can connect to the AP, good. The last "Fail" is irrelevant.
Can you ping 192.168.43.41 on your computer? If yes, how about 8.8.8.8?
What is the ip address assigned to your computer?

I also need the output of the follow commands for diagnostics(run them one by one as root in sManager):
1). ip r show
2). ip rule show
3). iptables -S
 
You can connect to the AP, good. The last "Fail" is irrelevant.
Can you ping 192.168.43.41 on your computer? If yes, how about 8.8.8.8?
What is the ip address assigned to your computer?

I also need the output of the follow commands for diagnostics(run them one by one as root in sManager):
1). ip r show
2). ip rule show
3). iptables -S

Ping to 192.168.43.41 & 8.8.8.8 fail. The DHCP IP I receive is 192.168.43.84.

Command:
'/storage/sdcard0/Tether_Scripts/diag.sh'
-------------
Out:
h '/storage/sdcard0/Tether_Scripts/diag.sh' <
default via 100.152.225.41 dev rmnet0
10.168.183.116 via 100.152.225.41 dev rmnet0
10.177.0.34 via 100.152.225.41 dev rmnet0
100.152.225.40/30 dev rmnet0 proto kernel scope link src 100.152.225.40
100.152.225.41 dev rmnet0 scope link
192.168.43.0/24 dev wlan0 proto kernel scope link src 192.168.43.1
0: from all lookup local
32765: from 100.152.225.40 lookup 1
32766: from all lookup main
32767: from all lookup default
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
-N bw_FORWARD
-N bw_INPUT
-N bw_OUTPUT
-N costly_rmnet0
-N costly_shared
-N natctrl_FORWARD
-N penalty_box
-A INPUT -j bw_INPUT
-A FORWARD -j bw_FORWARD
-A FORWARD -j natctrl_FORWARD
-A OUTPUT -j bw_OUTPUT
-A bw_INPUT ! -i lo+ -m quota2 ! --name globalAlert --quota 2097152
-A bw_INPUT -i rmnet0 -j costly_rmnet0
-A bw_INPUT -i lo -j RETURN
-A bw_INPUT -m owner --socket-exists
-A bw_OUTPUT ! -o lo+ -m quota2 ! --name globalAlert --quota 2097152
-A bw_OUTPUT -o rmnet0 -j costly_rmnet0
-A bw_OUTPUT -o lo -j RETURN
-A bw_OUTPUT -m owner --socket-exists
-A costly_rmnet0 -m quota2 ! --name rmnet0 --quota 9223372036854775807 -j REJECT --reject-with icmp-net-prohibited
-A costly_rmnet0 -j penalty_box
-A costly_shared -j penalty_box
 
Everything appears fine on android side. I suspect something is wrong in the routing table of windows.

What is the result of cmd "route print" on windows?
 
Just a thought, is there any way creating a new apn could bypass the tethering 'lock out' from the mpcs servers?
 
Here my log

Command:
'/storage/sdcard0/Download/Archive-1/tether.sh'
-------------
Out:
/ # exec /system/bin/sh '/storage/sdcard0/Download/Archive-1/tether.sh'
200 0 Softap operation succeeded
600 Iface linkstate wlan0 up
200 0 Softap operation succeeded
200 0 Softap operation succeeded
600 Iface linkstate wlan0 down
200 0 Softap operation succeeded
600 Iface linkstate wlan0 up
200 0 Interface configuration set
200 0 Tether operation succeeded
200 0 ipfwd operation succeeded
200 0 Tether operation succeeded
200 0 Tether operation succeeded
FAIL
 
Here my log

Command:
'/storage/sdcard0/Download/Archive-1/tether.sh'
-------------
Out:
/ # exec /system/bin/sh '/storage/sdcard0/Download/Archive-1/tether.sh'
200 0 Softap operation succeeded
600 Iface linkstate wlan0 up
200 0 Softap operation succeeded
200 0 Softap operation succeeded
600 Iface linkstate wlan0 down
200 0 Softap operation succeeded
600 Iface linkstate wlan0 up
200 0 Interface configuration set
200 0 Tether operation succeeded
200 0 ipfwd operation succeeded
200 0 Tether operation succeeded
200 0 Tether operation succeeded
FAIL

Can you find any new hotspot on your computer? Try to connect it if anything come out.

I'm currently on CarbonROM now, and I only tested my scripts on stock 4.1.2 . So I can not help much.
 
Can you find any new hotspot on your computer? Try to connect it if anything come out.

I'm currently on CarbonROM now, and I only tested my scripts on stock 4.1.2 . So I can not help much.
Im on xperion cant find a way to tether, tryed a few ways cant seem to make it work or i am doin something wrong
 
Back
Top Bottom