Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

Steps to enable TTL modification on Franklin T9:

  1. Read this blog
  2. Based on the blog, enable SSH.
  3. Once SSH is enabled, place this file in /etc/init.d/set_ttl:
#!/bin/bash
### BEGIN INIT INFO
# Provides:		ttl
# Required-Start:	$remote_fs $syslog $networking
# Required-Stop:	$remote_fs $syslog
# Default-Start:	2 3 4 5
# Default-Stop:		1
# Short-Description:	Set TTL in iptables
### END INIT INFO

TTL=66
INTERFACE=rmnet_data0

case "$1" in
  start)
	echo "Setting TTL on $INTERFACE to $TTL..."
	ip6tables -t mangle -I POSTROUTING -o $INTERFACE -j HL --hl-set $TTL
	ip6tables -t mangle -I PREROUTING -i $INTERFACE -j HL --hl-set $TTL
	iptables -t mangle -I POSTROUTING -o $INTERFACE -j TTL --ttl-set $TTL
	iptables -t mangle -I PREROUTING -i $INTERFACE -j TTL --ttl-set $TTL
	;;
  *)
	echo "$1 is not implemented"
	;;
esac

exit 0
  1. Adjust TTL to the value you desire
  2. chmod 755 /etc/init.d/set_ttl
  3. cd /etc/rc5.d/; ln -s ../init.d/set_ttl S99set_ttl
  4. reboot

If you upgrade firmware, this will need to be redone.

@drecha

This comment has been minimized.

Copy link

@drecha drecha commented Dec 14, 2020

Tried your steps, but no change to the TTL.

Please confirm that I only need to adjust the TTL value in one place on the script correct?

Where is says:

TTL=66
INTERFACE=rmnet_data0

I set mine to 65 and no change to the data cap of 5mb. Also, noticed quite a few other folders in the etc folder. Are you sure it goes in the rc5.d folder?

@xfgavin

This comment has been minimized.

Copy link

@xfgavin xfgavin commented Dec 18, 2020

Thank you for sharing. I found some results:
Carrier: Visible
with script: client was capped at 5MB/s
without script: client can go >10MB/s

Carrier: Cricket
with script: client was capped at 5MB/s
without script: client was capped <20KB/s
Interestingly, I only got 3G using cricket SIM.

@drecha

This comment has been minimized.

Copy link

@drecha drecha commented Dec 18, 2020

Set TTL as 64.

Visible:
Without Script 5MB/5MB
With Script 25MB/25MB

@xfgavin

This comment has been minimized.

Copy link

@xfgavin xfgavin commented Dec 19, 2020

No luck for me. Anything else did you tweak? APN? etc?

@drecha

This comment has been minimized.

Copy link

@drecha drecha commented Dec 19, 2020

Visible APN:
VSBLINTERNET
IPV4 only

Are you sure you did the script correctly?

First, I made a file in notepad with the specified script and named it S99set_ttl.txt

You only need to copy the script beginning with:

#!/bin/bash

...and ending with:

exit 0

Then I used PuTTY and WinSCP to drag and drop this file directly into the etc/rc5.d/ folder on the device. I then renamed it to remove the .txt from the file name and then right-clicked, select Properties, and gave it 755 rights. Then rebooted.

Much easier than following all the original steps.

@xfgavin

This comment has been minimized.

Copy link

@xfgavin xfgavin commented Dec 19, 2020

Thanks.
Positively, I've confirmed by pinging a target. I might have weak signal, I tried my sim card in my phone and got similar result. It's a bit weird though.

@sundown994

This comment has been minimized.

Copy link

@sundown994 sundown994 commented Dec 19, 2020

im a little stumped on the configuration.

Do I change where it says
TTL=66
INTERFACE=rmnet_data0

and make it like
echo "Setting TTL on $INTERFACE to $TTL=65"
ip6tables -t mangle -I POSTROUTING -o $INTERFACE -j HL --hl-set $TTL=65
ip6tables -t mangle -I PREROUTING -i $INTERFACE -j HL --hl-set $TTL=65
iptables -t mangle -I POSTROUTING -o $INTERFACE -j TTL --ttl-set $TTL=65
iptables -t mangle -I PREROUTING -i $INTERFACE -j TTL --ttl-set $TTL=65

I cant get it to stick for some reason

@drecha

This comment has been minimized.

Copy link

@drecha drecha commented Dec 19, 2020

No only change it in one place:

TTL=64
INTERFACE=rmnet_data0

.....and reboot to apply the changes.

@sundown994

This comment has been minimized.

Copy link

@sundown994 sundown994 commented Dec 19, 2020

No only change it in one place:

TTL=64
INTERFACE=rmnet_data0

.....and reboot to apply the changes.

I did that as well, and I get this

64 bytes from 192.168.0.1: icmp_seq=0 ttl=64 time=1.388 ms
64 bytes from 192.168.0.1: icmp_seq=1 ttl=64 time=1.893 ms
64 bytes from 192.168.0.1: icmp_seq=2 ttl=64 time=1.329 ms
64 bytes from 192.168.0.1: icmp_seq=3 ttl=64 time=1.304 ms
64 bytes from 192.168.0.1: icmp_seq=4 ttl=64 time=1.310 ms
64 bytes from 192.168.0.1: icmp_seq=5 ttl=64 time=1.690 ms

I am trying to set it to 65, so I replaced the 64 with a 65

@drecha

This comment has been minimized.

Copy link

@drecha drecha commented Dec 19, 2020

Are you connecting directly to the Franklin T9 device or you have a router connected to it?

@sundown994

This comment has been minimized.

Copy link

@sundown994 sundown994 commented Dec 19, 2020

@drecha

This comment has been minimized.

Copy link

@drecha drecha commented Dec 19, 2020

Did you follow the instructions I sent?

First, I made a file in notepad with the specified script and named it S99set_ttl.txt

You only need to copy the script beginning with:

#!/bin/bash

...and ending with:

exit 0

Then I used PuTTY and WinSCP to drag and drop this file directly into the etc/rc5.d/ folder on the device. I then renamed it to remove the .txt from the file name and then right-clicked, select Properties, and gave it 755 rights. Then rebooted.

@drecha

This comment has been minimized.

Copy link

@drecha drecha commented Dec 19, 2020

What are you connected to over USB? A desktop or a router?

@drecha

This comment has been minimized.

Copy link

@drecha drecha commented Dec 19, 2020

Try to see what speeds you get over WiFi

@sundown994

This comment has been minimized.

Copy link

@sundown994 sundown994 commented Dec 19, 2020

@drecha

This comment has been minimized.

Copy link

@drecha drecha commented Dec 19, 2020

You probably need to change the TTL on the desktop. If it’s Windows 10:

Open Registry Editor (regedit.exe).
From the HKEY_LOCAL_MACHINE subtree, go to the following key: \SYSTEM\CurrentControlSet\Services\Tcpip\Parameters.
In the right pane, add the following value: Name: DefaultTTL. Type: REG_DWORD. Valid Range: 1-255. (Try 64 or 65)
After that, please restart the computer and check the result.

@sundown994

This comment has been minimized.

Copy link

@sundown994 sundown994 commented Dec 19, 2020

@drecha

This comment has been minimized.

Copy link

@drecha drecha commented Dec 19, 2020

I just configure another Test Drive Hotspot device from scratch and I’m getting 25/25mb with Visible after the script!

So, if you’re using Visible, it will work if you follow the steps. Again I’ve only used both of these with Visible.

@ghostyroasty

This comment has been minimized.

Copy link

@ghostyroasty ghostyroasty commented Jan 23, 2021

I just configure another Test Drive Hotspot device from scratch and I’m getting 25/25mb with Visible after the script!

So, if you’re using Visible, it will work if you follow the steps. Again I’ve only used both of these with Visible.

To use with Visible, do you need to alter the imei of the t9?

@drecha

This comment has been minimized.

Copy link

@drecha drecha commented Jan 23, 2021

No need to change the IMEI.

@ghostyroasty

This comment has been minimized.

Copy link

@ghostyroasty ghostyroasty commented Jan 23, 2021

No need to change the IMEI.

Good to know, thanks!!! Now to find a party pay group.

@ghostyroasty

This comment has been minimized.

Copy link

@ghostyroasty ghostyroasty commented Jan 27, 2021

No need to change the IMEI.

Well I tried and after using it once, the firmware upgraded. I downgraded back to 891 and now I have no service on the Franklin. If I transfer the card over to a phone, all is well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment