1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Changing TTL for a single IP address

Discussion in 'Tomato Firmware' started by Dave2084, Mar 14, 2008.

  1. Dave2084

    Dave2084 LI Guru Member

    Hi,

    I need to change the TTL for a device on my system (on a static IP) which currently always sets TTL=1. In order for me to connect to a server on the internet I need to modify this to TTL=64.

    I'd prefer not to change the TTL for any other devices and I cannot change it at the device (it's a Pinball Machine).

    Is there something I can put in the startup script to do this?

    Thanks!
     
  2. mstombs

    mstombs Network Guru Member

    Try this from a telnet/ssh prompt

    Code:
    insmod ipt_TTL
    iptables -t mangle -I PREROUTING -i br0 -s 192.168.xxx.yyy -j TTL --ttl-set 64
    with your target machine IP address replacing 192.168.xxx.yyy

    If it works I guess you put the insmod in the start-up and the iptables command in the firewall script
     
  3. Dave2084

    Dave2084 LI Guru Member

    Thanks,

    That worked a treat. If I netnet inot the router and run the commands manually I's there, however I can't get it to do this automatically at startup

    Any ideas?
     
  4. mstombs

    mstombs Network Guru Member

    There is a potential issue with start-up, it runs very early, maybe too early but you can add a "sleep 10" to delay by 10 seconds.

    Both commands could go in the Firewall script (startup and firewall scripts are in the web gui by the way). Only potential issue is that the firewall script is run every time the WAN reconnects (the WAN UP script is just after connection is established), attempting to install the TTL target more than once will generate an error which can probably be ignored, if you get multiple TTL entries (iptables -t mangle -L) you'll need to remove the old rule before adding or some other logic.
     

Share This Page