From: Martin Josefsson Subject: Re: disturbing MTU experiment Date: 08 Apr 2003 22:43:21 +0200 Sender: netfilter-devel-admin@lists.netfilter.org Message-ID: <1049834601.3282.52.camel@tux.rsn.bth.se> References: <20030408154101.13919.89741.Mailman@kashyyyk> <16018.64600.149601.372694@isis.cs3-inc.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: Netfilter-devel Return-path: To: Don Cohen In-Reply-To: <16018.64600.149601.372694@isis.cs3-inc.com> Errors-To: netfilter-devel-admin@lists.netfilter.org List-Help: List-Post: List-Subscribe: , List-Unsubscribe: , List-Archive: List-Id: netfilter-devel.vger.kernel.org On Tue, 2003-04-08 at 18:44, Don Cohen wrote: I'm just going to note that the NAT code in iptables appears to have a small bug in the regard of icmp-errors. I've seen it with links that have smaller mtu (1476, GRE tunnels) and packets with the DF flag set. Host A <-> router B <- GRE tunnel -> router C <-> host D If I add a DNAT-rule in router B so that certain connections are redirected to host D things will go wrong. host A sends a 1500byte packet to the ip it thinks it's connected to and router B will try to send that to host D and will fail because of the smaller mtu and DF flag. Router B then generates an icmp fragmentation needed error-message and sends it to host A. This is where we have the problem. The icmp-error packet which was generated by router B has both the internal header and the external header rewritten. The internal header becomes correct (indicating the ip host A thinkgs it's connected to) but the external header (the ip-header of the icmp-error) will be wrong. It was also rewritten and now has the ip host A thinks it's connected to as source-ip... oops, should be the ip of router B. Linux ip-stack doesn't accept this icmp packet (havn't checked if conntrack thinks it qualifies as related or not). The NAT-code will do the right thing for icmp-errors that's passing through the router but not for locally generated errors. I havn't gone through the code enough yet to know how to solve it best... -- /Martin