Hi there people. I recently found an article about using a VPN set up along with routing tables to get tethering going using the phone in Hotsopt mode. Every thing is working well, but the one thing that I can't get going is to have the userinit.sh run at boot automatically.
The original poster said to put this text in the userinit.sh, and nothing else.
========================================================
iptables -t filter -F FORWARD
iptables -t nat -F POSTROUTING
iptables -t filter -I FORWARD -j ACCEPT
iptables -t nat -I POSTROUTING -j MASQUERADE
ip rule add from 192.168.43.0/24 lookup 61
ip route add default dev tun0 scope link table 61
ip route add 192.168.43.0/24 dev wlan0 scope link table 61
ip route add broadcast 255.255.255.255 dev wlan0 scope link table 61
========================================================
As I say I can execute this manually via root explorer, but can't get it to run automatically on boot. Thanks for any help with this.
Get ROM toolbox or something that runs scripts at boot
Thank you for your help. I will have a look at this app later and give it a go.
Hi there I have had chance to install Rom toolbox. I did the following, but still no luck:
main menu - scripter - add script (plus icon) - hit my userinit.sh and pressed to "set at boot icon". I rebooted the phone but the script did not work. I saw "access to interactive shell" from Rom toolbox popup, so something must have happened. Thanks for any more help.
Hi, Looking for help to update the M8 tether hack to work with lollipop on Sprint stock rooted ROM.
I was able to update the default.xml file ( sprint stock lollipop based) in the attached zip which enabled the hotspot and works great with 3g. The init.d tether script used to get LTE working in the zip worked great on kitkat when set correctly using SManager but it doesn't seem to work on lollipop as everyone is aware. I am not experienced enough to edit the tether script which I suspect is the issue with LTE and was hoping someone else here was. It's below and also attached in the zip file under system/etc/init.d which I am sure you know already. Of course it might be something much harder than a simple update of a script or it probably would have been done already....
(I can't attach the zip I was referring to since I haven't posted 10 posts yet but it's here)
http://forum.xda-developers.com/atta...9&d=1423894001
Thanks!
#!/system/bin/sh
iptables -F
iptables -A bw_FORWARD -i !lo+
iptables -A natctrl_FORWARD -j RETURN -i rmnet+ -o wlan0 -m state --state RELATED,ESTABLISHED
iptables -A natctrl_FORWARD -j DROP -i wlan0 -o rmnet+ -m state --state INVALID
iptables -A natctrl_FORWARD -j RETURN -i wlan0 -o rmnet+
iptables -A natctrl_FORWARD -j DROP
iptables -A natctrl_nat_POSTROUTING -t nat -o rmnet+ -j MASQUERADE
oh yeah, six pack of top shelf NW beer sent to the person that can get this working
robsoprano said:
Hi, Looking for help to update the M8 tether hack to work with lollipop on Sprint stock rooted ROM.
I was able to update the default.xml file ( sprint stock lollipop based) in the attached zip which enabled the hotspot and works great with 3g. The init.d tether script used to get LTE working in the zip worked great on kitkat when set correctly using SManager but it doesn't seem to work on lollipop as everyone is aware. I am not experienced enough to edit the tether script which I suspect is the issue with LTE and was hoping someone else here was. It's below and also attached in the zip file under system/etc/init.d which I am sure you know already. Of course it might be something much harder than a simple update of a script or it probably would have been done already....
(I can't attach the zip I was referring to since I haven't posted 10 posts yet but it's here)
http://forum.xda-developers.com/atta...9&d=1423894001
Thanks!
#!/system/bin/sh
iptables -F
iptables -A bw_FORWARD -i !lo+
iptables -A natctrl_FORWARD -j RETURN -i rmnet+ -o wlan0 -m state --state RELATED,ESTABLISHED
iptables -A natctrl_FORWARD -j DROP -i wlan0 -o rmnet+ -m state --state INVALID
iptables -A natctrl_FORWARD -j RETURN -i wlan0 -o rmnet+
iptables -A natctrl_FORWARD -j DROP
iptables -A natctrl_nat_POSTROUTING -t nat -o rmnet+ -j MASQUERADE
Click to expand...
Click to collapse
Why not post in the tether hack thread?
http://forum.xda-developers.com/showthread.php?t=2712222
'cause they required 10 posts which I now have
hi, please delete this thread, it has been added to this existing one:
http://forum.xda-developers.com/showthread.php?t=2712222&page=20
I used to be able to tether over wi-fi by connecting to an OpenVPN server, then activating the phone as a wi-fi hotspot, then running a script to route data traffic over the VPN. For some reason, this is not working anymore.
This is the script that used to work:
Code:
su -
iptables -t filter -F FORWARD
iptables -t nat -F POSTROUTING
iptables -t filter -A FORWARD -j ACCEPT
iptables -t nat -A POSTROUTING -j MASQUERADE
When this didn't work I tried this script:
Code:
su -
iptables -t filter -F FORWARD
iptables -t nat -F POSTROUTING
iptables -t filter -I FORWARD -j ACCEPT
iptables -t nat -I POSTROUTING -j MASQUERADE
ip rule add from 192.168.43.0/24 lookup 61
ip route add default dev tun0 scope link table 61
ip route add 192.168.43.0/24 dev wlan0 scope link table 61
ip route add broadcast 255.255.255.255 dev wlan0 scope link table 61
But this isn't working either. If I connect the VPN, turn on the hotspot, and then run the script, I can't get the 2nd device to connect to wi-fi. If I connect the VPN, run the script, then turn on the hotspot, I'm able to connect, but the 2nd device does not get routed over the VPN (which defeats the purpose).
Is anybody doing this successfully and, if so, how are you doing it?
OK,
After some experimenting, I got this to work. For the benefit of anybody else trying to do this, here are the instructions that worked:
1. Turn on wi-fi hotspot on phone and connect from tethered device
2. Connect to your VPN (I use OpenVPN)
3. Using teminal emulator or other terminal program navigate to the location of the tether_routing .sh script
3. type su <cr>
4. type sh tether_routing.sh
Make sure you follow these steps in exactly this order!
Check to make sure your tethered device is actually connecting through the VPN (http://whatismyipaddress.com)
I changed the tether_routing.sh script slightly. For some reason, it seems to work better when 'su' is typed before running the script and not put in the script.
Code:
#!/system/bin/sh
iptables -t filter -F FORWARD
iptables -t nat -F POSTROUTING
iptables -t filter -I FORWARD -j ACCEPT
iptables -t nat -I POSTROUTING -j MASQUERADE
ip rule add from 192.168.43.0/24 lookup 61
ip route add default dev tun0 scope link table 61
ip route add 192.168.43.0/24 dev wlan0 scope link table 61
ip route add broadcast 255.255.255.255 dev wlan0 scope link table 61
Thank you for this! I have been trying to find a solution for a long time. I have an s6 now, but I'll try this weekend to see if it will work for me.
woody1 said:
OK,
After some experimenting, I got this to work. For the benefit of anybody else trying to do this, here are the instructions that worked:
1. Turn on wi-fi hotspot on phone and connect from tethered device
2. Connect to your VPN (I use OpenVPN)
3. Using teminal emulator or other terminal program navigate to the location of the tether_routing .sh script
3. type su <cr>
4. type sh tether_routing.sh
Make sure you follow these steps in exactly this order!
Check to make sure your tethered device is actually connecting through the VPN (http://whatismyipaddress.com)
I changed the tether_routing.sh script slightly. For some reason, it seems to work better when 'su' is typed before running the script and not put in the script.
Code:
#!/system/bin/sh
iptables -t filter -F FORWARD
iptables -t nat -F POSTROUTING
iptables -t filter -I FORWARD -j ACCEPT
iptables -t nat -I POSTROUTING -j MASQUERADE
ip rule add from 192.168.43.0/24 lookup 61
ip route add default dev tun0 scope link table 61
ip route add 192.168.43.0/24 dev wlan0 scope link table 61
ip route add broadcast 255.255.255.255 dev wlan0 scope link table 61
Click to expand...
Click to collapse
Thanks, I still couldn't get it to work. It is most likely user error, as I'm a bit of a newbie creating (copying/pasting/saving) scripts.
dave812 said:
Thanks, I still couldn't get it to work. It is most likely user error, as I'm a bit of a newbie creating (copying/pasting/saving) scripts.
Click to expand...
Click to collapse
You might try typing the commands into a terminal window one by one instead of putting them in a script. If you can get that to work, you can experiment with getting them to work in a script.
I found that in order for the script to work you need to convert the text file to unix format without the carriage return after each line. If you are creating the script in certain text editors in Windows there will be a carriage return.
Use this dos2unix utility to remove the carriage returns in the script and then it will work.
http://sourceforge.net/projects/dos2unix
uniphase said:
I found that in order for the script to work you need to convert the text file to unix format without the carriage return after each line. If you are creating the script in certain text editors in Windows there will be a carriage return.
Use this dos2unix utility to remove the carriage returns in the script and then it will work.
http://sourceforge.net/projects/dos2unix
Click to expand...
Click to collapse
You are correct about this script and this applies to any plain text file that's created in a Windows environment, then used on a Linux/Unix based system. I use Notepad++ on Windows which has an option to display and change the end-of-line style in use for a given file.
woody1 said:
OK,
After some experimenting, I got this to work. For the benefit of anybody else trying to do this, here are the instructions that worked:
1. Turn on wi-fi hotspot on phone and connect from tethered device
2. Connect to your VPN (I use OpenVPN)
3. Using teminal emulator or other terminal program navigate to the location of the tether_routing .sh script
3. type su <cr>
4. type sh tether_routing.sh
Make sure you follow these steps in exactly this order!
Check to make sure your tethered device is actually connecting through the VPN (http://whatismyipaddress.com)
I changed the tether_routing.sh script slightly. For some reason, it seems to work better when 'su' is typed before running the script and not put in the script.
Code:
#!/system/bin/sh
iptables -t filter -F FORWARD
iptables -t nat -F POSTROUTING
iptables -t filter -I FORWARD -j ACCEPT
iptables -t nat -I POSTROUTING -j MASQUERADE
ip rule add from 192.168.43.0/24 lookup 61
ip route add default dev tun0 scope link table 61
ip route add 192.168.43.0/24 dev wlan0 scope link table 61
ip route add broadcast 255.255.255.255 dev wlan0 scope link table 61
Click to expand...
Click to collapse
in this line>>>>> ip rule add from 192.168.43.0/24 lookup 61 <<<<<the ip is universal???
---------- Post added at 09:18 PM ---------- Previous post was at 08:48 PM ----------
I tried it with psiphon 113. I use ipleak.net btw and from my phone which is the device that share the connection it works as it should. But from the tablet which I connect through the phone I have DNS leak. The phone takes ip,dns from the vpn and the tablet gets only the ip but dns from Greece. It is also weird thst it doesn't take dns from Vodafone but generally dns from Greece... any ideas??
Dears maybe now I can make double post but I hang on that step from guide from this site.
Phone is after wipe data and I need rescue data from it for that I want to make RAW image to recover data.
What I do until now:
adb forward tcp:5555 tcp:5555
adb shell
su
/system/xbin/busybox nc -l -p 5555 -e /system/xbin/busybox dd if=/dev/block/mmcblk0
but in results get:
1|ASUS_I001_1:/ # /system/xbin/busybox nc -1 -p 5555 -e /system/xbin/busybox dd
5555 -e /system/xbin/busybox dd if=/dev/block/mmcblk0 <
nc: invalid option -- 1
BusyBox v1.32.0-Stericson (2020-07-18 18:33:24 EDT) multi-call binary.
Usage: nc [OPTIONS] HOST PORT - connect
nc [OPTIONS] -l -p PORT [HOST] [PORT] - listen
-e PROG Run PROG after connect (must be last)
-l Listen mode, for inbound connects
-lk With -e, provides persistent server
-p PORT Local port
-s ADDR Local address
-w SEC Timeout for connects and final net reads
-i SEC Delay interval for lines sent
-n Don't do DNS resolution
-u UDP mode
-v Verbose
-o FILE Hex dump traffic
-z Zero-I/O mode (scanning)
1|ASUS_I001_1:/ #
Why I get that this parameter is invalid:
nc: invalid option -- 1
And to the end, if that don't work to me, next step also don't work.
Open another Cygwin terminal and type:
Code:
adb forward tcp:5555 tcp:5555
cd /path/to/store/the/backup ---> this is correct, should I creat some folder on HHD and insert here his name?
nc 127.0.0.1 5555 | pv -i 0.5 > mmcblk0.raw --> that means I should have ftp serwer?
Mod edit: @Vergiliusz Thread closed as duplicate of
Ho to back up of the whole memory block (via adb)
Dears maybe now I can make double post but I hang on that step from guide from this site. Phone is after wipe data and I need rescue data from it for that I want to make RAW image to recover data. What I do until now: adb forward tcp:5555...
forum.xda-developers.com
Please review the XDA Forum Rules with special emphasis on rule no. 5 and post only once - and such a subject not in development!
Regards
Oswald Boelcke
Dears maybe now I can make double post but I hang on that step from guide from this site.
Phone is after wipe data and I need rescue data from it for that I want to make RAW image to recover data.
What I do until now:
adb forward tcp:5555 tcp:5555
adb shell
su
/system/xbin/busybox nc -l -p 5555 -e /system/xbin/busybox dd if=/dev/block/mmcblk0
but in results get:
1|ASUS_I001_1:/ # /system/xbin/busybox nc -1 -p 5555 -e /system/xbin/busybox dd
5555 -e /system/xbin/busybox dd if=/dev/block/mmcblk0 <
nc: invalid option -- 1
BusyBox v1.32.0-Stericson (2020-07-18 18:33:24 EDT) multi-call binary.
Usage: nc [OPTIONS] HOST PORT - connect
nc [OPTIONS] -l -p PORT [HOST] [PORT] - listen
-e PROG Run PROG after connect (must be last)
-l Listen mode, for inbound connects
-lk With -e, provides persistent server
-p PORT Local port
-s ADDR Local address
-w SEC Timeout for connects and final net reads
-i SEC Delay interval for lines sent
-n Don't do DNS resolution
-u UDP mode
-v Verbose
-o FILE Hex dump traffic
-z Zero-I/O mode (scanning)
1|ASUS_I001_1:/ #
Why I get that this parameter is invalid:
nc: invalid option -- 1
And to