Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Feb 2004 17:00:05 +0200
From:      "Alexander Botov" <alexb@mail.bg>
To:        <freebsd-questions@freebsd.org>
Subject:   RE: forwarding with ttl=1
Message-ID:  <00a301c3ebf8$bd939b50$0200a8c0@ALIENX>

next in thread | raw e-mail | index | archive | help
> > The problem is that the ISP's
> > gateway returns every time packets with ttl=1 which makes
> > further forwarding impossible . My gateway returns icmp error
> > mesage "time exceeded" and discards packets .
>
> TTL (Time To Live) is a counter value in an IP packet that gets
> decremented
> by every "hop" (router). When it reaches a value of zero, the packet is
> discarded.
>
> Using a TTL of 1 isn't going to be very useful as your packets will all be
> discarded at the first router. This is working as intended.
>

 That's what I mean . The incoming packets are with TTL=1 and my gateway
cannot forward them to the local network . Probably the reason is that the
ISP doesn't want from his clients to share one Internet connection between
different machines in the local network . I dont have problem with outgoing
packets .

here is the code fragment from ip_forward() in ip_input.c
/usr/src/sys/netinet/ip_input.c :
if  (ip->ip_ttl <= IPTTLDEC) { //Yes !!! the TTL == 1
     icmp_error(m, ICMP_TIMXCEED, ICMP_TIMXCEED_INTRANS,0, 0);
     return;
 }

and further:
    ip->ip_ttl -= IPTTLDEC;

when i execute netstat -s there is a big number of icmp time exceed errors
indicating that the packets are discarded because of TTL expiration  I need
a way to avoid this .

Thanks




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?00a301c3ebf8$bd939b50$0200a8c0>