All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Andrew E. Mileski" <andrewm@isoar.ca>
To: netfilter@lists.netfilter.org
Subject: Re: NAT and DNS/NTP servers
Date: Sat, 01 May 2004 13:42:40 -0400	[thread overview]
Message-ID: <4093E190.8020308@isoar.ca> (raw)
In-Reply-To: <200405010819.30079.Antony@Soft-Solutions.co.uk>

Antony Stone wrote:
> On Saturday 01 May 2004 3:52 am, Andrew E. Mileski wrote:
> 
>>I'm observing lost packets when a gateway doing NAT also locally hosts
>>a server for DNS or NTP.  I believe this the result of the ambiguous
>>conditions that can exist when routing server-to-server packets coming
>>into the gateway.
> 
> Show us your rules and explain what is ambiguous about them?

There is only one rule needed if all other defaults are ACCEPT:

This one is on my network:
iptables -t nat -A POSTROUTING -s ! $WAN_IP -o $WAN_IFC -j SNAT 
--to-source $WAN_IP

This one is on another network with the same problem:
iptables -t nat -A POSTROUTING -s $INTERNAL_NET -j MASQUERADE

Both DNS and NTP server-to-server UDP packets have the same source
and destination ports.  What I am seeing is a failure to remap the
source port on outgoing packets when a local server is running on
the gateway.

I speculate this is because an idle local server without an active
connection doesn't have an entry in the connection table.  Though
I've also seen failures with an active local server, but I haven't
got a good theory on the mechanics behind it yet.

I have seen port remapping in some situations, so I know that
feature works.  It just isn't being triggered in some situations,
which I can't yet reason why.

As an aside, I think (S?)NTP pays attention to the source port, so
a port remap may have side effects for this protocol.  This isn't
a concern of mine though.

-- 
Andrew E. Mileski


  reply	other threads:[~2004-05-01 17:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-01  2:52 NAT and DNS/NTP servers Andrew E. Mileski
2004-05-01  7:19 ` Antony Stone
2004-05-01 17:42   ` Andrew E. Mileski [this message]
2004-05-01 17:49     ` Andrew E. Mileski
2004-05-01 18:05     ` Antony Stone
2004-05-01 19:51       ` Andrew E. Mileski
2004-05-01 20:00         ` Andrew E. Mileski
2004-05-01 20:21         ` Antony Stone
2004-05-01 20:48           ` Andrew E. Mileski
2004-05-01 21:07             ` Antony Stone
2004-05-01 21:42               ` Andrew E. Mileski
2004-05-01 23:17                 ` Antony Stone
  -- strict thread matches above, loose matches on Subject: below --
2004-05-02 13:49 Steve Jones
2004-05-03  0:14 ` Andrew E. Mileski

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=4093E190.8020308@isoar.ca \
    --to=andrewm@isoar.ca \
    --cc=netfilter@lists.netfilter.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.