What's new

TTL script is not working properly.

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

KGB7

Very Senior Member
Im using a simple script in my asus68u router, running lates Merlin firmware 384.15.

Here is the script.
-------------------------------------------------------------------------------
nano /jffs/scripts/nat-start

#!/bin/sh sleep 10
modprobe xt_HL
modprobe xt_hl
iptables -t mangle -A POSTROUTING -o -usb0 -j TTL --ttl-set 65

chmod a+rx /jffs/scripts/*
-------------------------------------------------------------------------------

With the script, if I set TTL to 65 or 100, ping test shows my TTL is 52-54.
With out script, ping test shows TTL of 45.
This is using ping test with in the router it self and with in CMD in Windows.


Is there an issue with my script??

Thanks.
 
The minus sign in front of the interface name (-usb0) looks wrong. What is the name of your WAN interface?

You have a "sleep 10" command on the first line after the shebang which is wrong.

You've posted in the wrong sub-forum. Your question is about a Merlin script.

What problem are you trying to solve with this script? There's already a "Spoof LAN TTL" option in Merlin's firmware which may do what you want.

With the script, if I set TTL to 65 or 100, ping test shows my TTL is 52-54.
With out script, ping test shows TTL of 45.
This is using ping test with in the router it self and with in CMD in Windows.
Assuming the script is working it will have no effect on the TTL numbers shown by a ping command. This script alters the outgoing TTL. The remote server sets the return TTL value and this will vary from site to site.
 
Last edited:
The minus sign in front of the interface name (-usb0) looks wrong. What is the name of your WAN interface?

You have a "sleep 10" command on the first line after the shebang which is wrong.

You've posted in the wrong sub-forum. Your question is about a Merlin script.

What problem are you trying to solve with this script? There's already a "Spoof LAN TTL" option in Merlin's firmware which may do what you want.


Assuming the script is working it will have no effect on the TTL numbers shown by a ping command. This script alters the outgoing TTL. The remote server sets the return TTL value and this will vary from site to site.

Im using a dedicated hotspot connected to router via USB, as my main internet sources. Thats why I have -usb0.

The only issues i'm trying to solve, is im not getting 100% of my DL speed with out the script. I'll get around 80%. And at times the webpages take a while to load.
I tried the spoof settings, but neither one did anything and thats why I resorted to using a small script.

Does it really matter where its posted? Aren't scripts universal?

So should I delete the "sleep 10" line all together?
 
No, scripts aren't universal. User scripts like nat-start are only part of Merlin's firmware. Stock Asus firmware does not support user scripts. Other firmwares like DD-WRT or OpenWRT have their own way of doing things.

Changing the TTL value shouldn't have any effect on download speeds. The reason people were doing that was because some mobile operators were trying to stop people tethering their phones by examining the TTL. This resulted in web sites being unreachable, but didn't effect speed AFAIK. That is what "Spoof LAN TTL" does, it sets the TTL to 64 so the mobile operator thinks there's only one device connected to the network.

As it stands your script is having no effect because "-usb0" is not a valid interface name (although "usb0" could be). I suspect you copied that typo from this post. You can ascertain your router's current WAN interface name with this command:
Code:
nvram get wan0_ifname

I don't know the thinking behind the "sleep 10" line. It seems unnecessary but if you want to include it it needs to be on a line by itself.
 
Last edited:
No, scripts aren't universal. User scripts like nat-start are only part of Merlin's firmware. Stock Asus firmware does not support user scripts. Other firmwares like DD-WRT or OpenWRT have their own way of doing things.

Changing the TTL value shouldn't have any effect on download speeds. The reason people were doing that was because some mobile operators were trying to stop people tethering their phones by altering the TTL. This resulted in web sites being unreachable, but didn't effect speed AFAIK. That is what "Spoof LAN TTL" does, it sets the TTL to 64 so the mobile operator thinks there's only one device connected to the network.

As it stands your script is having no effect because "-usb0" is not a valid interface name (although "usb0" could be). I suspect you copied that typo from this post. You can ascertain your router's current WAN interface name with this command:
Code:
nvram get wan0_ifname

I don't know the thinking behind the "sleep 10" line. It seems unnecessary but if you want to include it it needs to be on a line by itself.

The sleep 10 is supposed to be for waiting 10seconds before starting the script. Ill try with out it.
its usb0 with out the -.

Thanks for your help.
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top