Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have following startup (Administration-Commands-Startup script) script in my dd-wrt router

iptables -t mangle -I POSTROUTING -o `get_wanface` -j TTL --ttl-set 128

However it does not work. I suppose startup script run when iptables is not working yet. Are there any way to set ttl every time when router starts?

share|improve this question
up vote 1 down vote accepted

iptables with that command does not set ttl at router start-up

it sets the ttl for "every" packet at POSTROUTING that means when exiting the routing engine...

share|improve this answer
What do you mean? Sorry, I am not so good with iptables. What I want to say is that command does not work from startup script, however it works when I run it after router started from ssh session. – misha nesterenko Dec 15 '12 at 15:26
iptables is an interface to the kernel net-filter/router engine, then the command you mention tells the kernel net-filter/router that for every net packet that leaves the routing engine "mangle" (manipulate/set) the TTL field to a certain value. Remeber it is the kernel who does the things, iptables is the way you tell the kernel what to do with the packets. When the init script is run the kernel is already working then try to see if the command is well conformed and really present on a script that is really run on init – Pat Dec 15 '12 at 20:01
How can I get current ttl value from iptables? – misha nesterenko Dec 16 '12 at 10:23
you have to list iptables tables i.e "iptables iptables -nL -v --line-numbers -t mangle" – Pat Dec 16 '12 at 13:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .