Steps to enable TTL modification on Franklin T9:
- Read this blog
- Based on the blog, enable SSH.
- 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
- Adjust
TTL
to the value you desire chmod 755 /etc/init.d/set_ttl
cd /etc/rc5.d/; ln -s ../init.d/set_ttl S99set_ttl
reboot
If you upgrade firmware, this will need to be redone.
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