Development discussion of WireGuard
 help / color / mirror / Atom feed
From: em12345 <em12345@web.de>
To: WireGuard mailing list <wireguard@lists.zx2c4.com>
Subject: Re: Varying source address and stateful firewalls (Was: Multiple Endpoints)
Date: Tue, 10 Jan 2017 01:33:29 +0100	[thread overview]
Message-ID: <33fed77c-4367-2411-0666-5c75148d1608@web.de> (raw)

Hi Baptiste,

after seeing

    https://wiki.asterisk.org/wiki/display/TOP/NAT+Traversal+Testing

I realized that the connection tracking with its state calculation and
the SNAT port mapping are two different things which don't have to
follow the same rules related to src/dst IP and ports.

This could be an explanation why Jason tested the NATed whole punching
successful with different src IPs, while your example failed.

The iptables connection tracking really does include src and dst IP
according to:

     http://www.iptables.info/en/connection-state.html

So iptables ESTABLISHED filter rules require the src,dst and both ports.

But may be the iptables NAT port mapping does not require this. The
iptables man page is vague on MASQUERADE and SNAT target.


Anyway, only packets with an existing port mapping (however this is
determined) will make it into the FORWARD chain from WAN to LAN interface.
Therefore it would not really be necessary to check for ESTABLISHED in
the FORWARD chain for those WAN-to-LAN packets. Assuming that there are
really showing up such NEW packets.

However in your example which is only using the INPUT chain, one of
course has to filter out the NEW packets here.


Emmanuel

             reply	other threads:[~2017-01-10  0:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-10  0:33 em12345 [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-01-07 14:43 Multiple Endpoints em12345
2017-01-07 15:23 ` Jason A. Donenfeld
2017-01-07 16:45   ` em12345
2017-01-08 14:12     ` Baptiste Jonglez
2017-01-08 22:18       ` Jason A. Donenfeld
2017-01-08 22:57         ` Baptiste Jonglez
2017-01-08 23:00           ` Jason A. Donenfeld
2017-01-09 11:35             ` Varying source address and stateful firewalls (Was: Multiple Endpoints) Baptiste Jonglez
2017-01-10  4:32               ` Jason A. Donenfeld

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=33fed77c-4367-2411-0666-5c75148d1608@web.de \
    --to=em12345@web.de \
    --cc=wireguard@lists.zx2c4.com \
    /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;
as well as URLs for NNTP newsgroup(s).