Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurentp@cse-semaphore.com>
To: netfilter@vger.kernel.org
Subject: Support for ICMP Time Exceeded in REJECT target ?
Date: Wed, 9 Jan 2008 18:18:36 +0100	[thread overview]
Message-ID: <200801091818.38810.laurentp@cse-semaphore.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1627 bytes --]

Hi everybody,

I'm trying to add some layer 3 functionalities to a Linux-based layer 2 
bridge.

The goal is to enumerate the bridges between two endpoints using the 
traceroute command. As the Linux bridge code routes frames at the ethernet 
level, the IP TTL is not decremented and no ICMP Time Exceeded reply is sent, 
making the bridge transparent.

I experimented with iptables and found out that I can decrement the TTL in the 
PREROUTING chain (mangle table) with

iptables -t mangle -A PREROUTING -j TTL --ttl-dec 1

To generate an ICMP Time Exceeded reply when the TTL reaches zero, I tried the 
REJECT target in the FORWARD chain (filter table). The REJECT target doesn't 
support ICMP Time Exceeded, but it was pretty straightforward to fix this.

Adding

iptables -t filter -A FORWARD -m ttl --ttl-eq 0 -j REJECT --reject-with 
icmp-time-exceeded

the bridges show up in the traceroute output.

Why doesn't REJECT support ICMP Time Exceeded ? Is there a good reason, or is 
it just that nobody has needed it yet ? Should I submit a patch (Linux kernel 
netfilter + userspace iptables) ?

I know that my application breaks the OSI model and creates some kind of 
hybrid "layer 2.5" device. I'm open to suggestions regarding a better way to 
implement bridges enumeration between two ethernet hosts, but using the 
traceroute command is a customer requirement which could only be changed with 
strong valid reasons.

Best regards,

-- 
Laurent Pinchart
CSE Semaphore Belgium

Chaussée de Bruxelles, 732A
B-1410 Waterloo
Belgium

T +32 (2) 387 42 59
F +32 (2) 387 42 75

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

             reply	other threads:[~2008-01-09 17:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-09 17:18 Laurent Pinchart [this message]
2008-01-10  8:38 ` Support for ICMP Time Exceeded in REJECT target ? Gáspár Lajos
2008-01-10  9:23   ` Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200801091818.38810.laurentp@cse-semaphore.com \
    --to=laurentp@cse-semaphore.com \
    --cc=netfilter@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox