• 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
Jan 24, 2014
20
2
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

  • Archive.zip
    625 bytes · Views: 169
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.
 
Upvote 0
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
 
Upvote 0
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
 
Upvote 0
Just a thought, is there any way creating a new apn could bypass the tethering 'lock out' from the mpcs servers?

Thank You for the scripts and assistance. I went ahead and flashed the KitKat ROM by hroark13 and figured out how to bypass tether restrictions on that ROM.

These steps may help MetroPCS & T-Mobile users who use your scripts:

http://androidforums.com/6773560-post716.html
 
Upvote 0
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
 
Upvote 0
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.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones