All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jay Foster <jay@systech.com>
To: netfilter@vger.kernel.org
Subject: iptables fails to NAT some packets
Date: Thu, 10 Oct 2013 15:56:27 -0700	[thread overview]
Message-ID: <5257309B.8030204@systech.com> (raw)

I have a gateway application which I am using iptables to NAT from a LAN 
interface to a WAN interface (linux 3.2.6).  This mostly works well, 
except that I sometimes see (via wireshark) IP packets being sent out 
the WAN interface that originated from the LAN interface that iptables 
fails to apply NAT.

These packets seem to usually be FIN, FIN/ACK, or RST packets.  I 
suspect that these are for IP connections from the device connected to 
the LAN interface that were setup prior to being connected to the 
gateway on which I am running iptables.  After some time, I think the 
application on the connected device decides to close these connections 
(FIN), but iptables fails to NAT these packets.  Why?

 From the iptables man page:

               nat:
                   This table is consulted when a packet  that  creates  
a  new
                   connection  is encountered.  It consists of three 
built-ins:
                   PREROUTING (for altering packets as soon as they  
come  in),
                   OUTPUT  (for altering locally-generated packets 
before rout-
                   ing), and POSTROUTING (for  altering  packets  as  
they  are
                   about to go out).

I'm concerned about the statement that says, "when a packet that creates 
a new connection is encountered".  Since the SYN packet for the problem 
FIN,RST packets was not seen by iptables, does this mean that iptables 
will not NAT the FIN packet?  This would seem wrong to me.

Jay


             reply	other threads:[~2013-10-10 22:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-10 22:56 Jay Foster [this message]
2013-10-11  6:26 ` iptables fails to NAT some packets Tom van Leeuwen

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=5257309B.8030204@systech.com \
    --to=jay@systech.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.