Skip to content

Instantly share code, notes, and snippets.

@weirded
Created October 26, 2020 21:29
  • Star 17 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save weirded/f49ac134aecbd32b71ab22619c7496ab to your computer and use it in GitHub Desktop.

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.

@sundown994
Copy link

sundown994 commented Dec 19, 2020 via email

@drecha
Copy link

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
Copy link

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
Copy link

drecha commented Jan 23, 2021

No need to change the IMEI.

@ghostyroasty
Copy link

No need to change the IMEI.

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

@ghostyroasty
Copy link

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.

@numberlstunna
Copy link

Will the TTL change work without USB tether? Can you connect to T9 via wireless and have the TTL @ 65?

@espinola17
Copy link

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.

are you able to help me modify ttl settings? New to coding and i've unlocked my T9 and can access root of device via wifi using mac terminal but struggling on what to do next. I created a file with the code you mentioned but I don't know how to properly code in terminal to move the file to the Franklin T9

@nmz787
Copy link

nmz787 commented Dec 29, 2021

on firmware 891, ifconfig doesn't show rmnet_data0 but rather rmnet0, and when I tried pasting in the comment you made on snt.sh, neither the iptable nor ip6tables commands work (I get an error message telling me to check the syntax in the help info, i.e. -h). Should I change my adapter interface to rmnet0 or is rmnet_data0 correct (I'm not an iptables wiz)?

Edit: after playing with various options, I found rmnet_data0 did work. Here's what I finally ended up with:

~ # cat /etc/rc5.d/S99set_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=64
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

@letthelightin
Copy link

letthelightin commented Mar 29, 2022

I can't get this script automatically running on firmware 891. I confirm to see what rules are active via commands:

iptables -L PREROUTING -t mangle
iptables -L POSTROUTING -t mangle

ip6tables -L PREROUTING -t mangle
ip6tables -L POSTROUTING -t mangle

The commands function great when manually run via SSH.

Any ideas?

edit1:

less /var/log/boot

Tue Mar 29 19:50:01 2022: Starting powerconfig for mdm9607: /etc/init.d/rc: line 174: /etc/rc5.d/S99set_ttl: not found

edit2: solved - issue was with a return character in the script file

https://confluence.atlassian.com/kb/starting-service-on-linux-throws-a-no-such-file-or-directory-error-794203722.html

sed -i -e 's/\r//g' /etc/init.d/set_ttl

@keldar21
Copy link

keldar21 commented Nov 7, 2022

Was anyone able to raise the max connections to this hotspot? I cant seem to find the right setting. changing max_num_sta in the wifi config files seems to only change it on the admin web pages, I still cant connect more devices...

@ftt1211
Copy link

ftt1211 commented Dec 31, 2023

those script commands didn't work for me. Here's mine that worked instead:

#!/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

case "$1" in
start)
iptables -t mangle -I POSTROUTING 1 -j TTL --ttl-set 65
;;
*)
echo "$1 is not implemented"
;;
esac

exit 0

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