Skip to contentSkip to conversation

TTL Target DOESN'T work with kernel 2.6.x!

DISCUSSION Mario 2 participants 2 messages Feb 23, 2004 – Feb 25, 2004 netfilter

lore
Share & tools
lore

Mario

author
#0 lore raw

I've tried the latest pom-ng.The patch applies successful. I precompile the kernel 2.6.3 after that iptables 1.2.9. I insert PREROUTING rules in the mangle table to set incoming TTL.

iptables -A PREROUTING -i eth0 -p tcp -j TTL --ttl-set 65 (from internal net) iptables -A PREROUTING -i eth1 -j TTL --ttl-set 64 (from external)

Chain PREROUTING (policy ACCEPT 18M packets, 15G bytes)

 pkts bytes target     prot opt in     out     source              destination
 344K   21M TTL        tcp  --  eth0   any     anywhere             anywhere 

TTL set to 65
3445K 3209M TTL all -- eth1 any anywhere anywhere
TTL set to 64

No erros. I'm pinging some hosts but there ttl wasn't set. Using tcpdump i saw that ttl was changed (may be) it looks like that.

ftp.bs.spnet.net is from external net (eth1) TTL shoud be set to 64!!!

root@darkstar:~$ tcpdump -v -i eth1 dst 172.16.111.111
07:44:44.954151 ftp.bs.spnet.net > 172.16.111.111: icmp: echo reply (DF) [tos 
0x60]  (ttl 64, id 0, len 84)

but

root@darkstar:~$ ping ftp.bs.spnet.net
PING debian.bs.spnet.net (212.50.0.39) 56(84) bytes of data.
64 bytes from ftp.bs.spnet.net (212.50.0.39): icmp_seq=1 ttl=1 time=2.40 ms

Local programs show me the real ttl, not the set one. I tried to route to my other pc it doesn't work (my ISP sets incoming ttl to 1)...my linux box sends time exceeded to the gateway.so whats the
point? This patch doesn't work correctrly or maybe i'm wrong. Does anybody know where the problem is? Did anybody test?

Mario

kernel 2.6.3 stable
iptables 1.2.9
patch-o-matic-ng-2004022 (CVS) TTL Target patch ONLY

#1 lore raw
Quoted 10 lines · Mario

but

root@darkstar:~$ ping ftp.bs.spnet.net
PING debian.bs.spnet.net (212.50.0.39) 56(84) bytes of data.
64 bytes from ftp.bs.spnet.net (212.50.0.39): icmp_seq=1 ttl=1 time=2.40 ms

Local programs show me the real ttl, not the set one. I tried to route to my other pc it doesn't work (my ISP sets incoming ttl to 1)...my linux box sends time exceeded to the gateway.so whats the
point? This patch doesn't work correctrly or maybe i'm wrong.

Thanks, I have fixed the bug in patch-o-matic CVS. Please try with the current CVS code.

Quoted 1 line

Mario

Signature · 5 lines
- Harald Welte <[email protected]>             http://www.netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie