Development discussion of WireGuard
 help / color / mirror / Atom feed
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Vasili Pupkin <diggest@gmail.com>
Cc: jwollrath@web.de, WireGuard mailing list <wireguard@lists.zx2c4.com>
Subject: Re: [PATCH] wg-quick: linux: add support for nft and prefer it
Date: Tue, 10 Dec 2019 18:38:41 +0100	[thread overview]
Message-ID: <CAHmME9pBZoHh+D5+EL6yDXJWqrDOm91bXocH3=8ztCsX489-qw@mail.gmail.com> (raw)
In-Reply-To: <c51624f6-b243-07dc-9edc-0cc7bf9a75ab@gmail.com>

On Tue, Dec 10, 2019 at 6:30 PM Vasili Pupkin <diggest@gmail.com> wrote:
>
> On 10.12.2019 18:48, Jason A. Donenfeld wrote:
>
> > restore '%s-I PREROUTING ! -i %s -d %s -m addrtype ! --src-type LOCAL -j DROP
> > nftcmd '%sadd rule %s %s preraw iifname != %s %s daddr %s fib saddr type != local drop
>
>
> I am trying to understand the rulesets. When you check the type of the
> source address of the incoming packet its type just can't be local to
> our machine, it is the address of the sender. The source address of the
> packet can only be local if the packet was sent from the same machine.
> Isn't this part of the rule redundant?

Those lines are supposed to do the same thing, by the way. If I
screwed up and they differ subtly, please let me know.

The ! --src-type LOCAL thing makes it so that you can still ping
yourself locally. "Allow loopback." This also has the side effect of
letting in dangerous packets that are masquerading as 127/8, but only
if you've explicitly opted in to net.ipv4.conf.lo.route_localnet=1 and
maybe one other safety nob, which nobody in their right mind does for
obvious reasons.
_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

      reply	other threads:[~2019-12-10 17:39 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-10 15:48 Jason A. Donenfeld
2019-12-10 16:52 ` Jordan Glover
2019-12-10 16:54   ` Jason A. Donenfeld
2019-12-10 17:05     ` Jordan Glover
2019-12-10 17:11       ` Jason A. Donenfeld
2019-12-10 17:12     ` Roman Mamedov
2019-12-10 17:28       ` Davide Depau
2019-12-10 17:33       ` Matthias Urlichs
2019-12-10 17:36       ` Jason A. Donenfeld
2019-12-10 18:00         ` Roman Mamedov
2019-12-10 18:58         ` Jordan Glover
2019-12-10 19:15           ` Jason A. Donenfeld
2019-12-10 20:30             ` Jordan Glover
2019-12-10 20:34               ` Jason A. Donenfeld
2019-12-10 21:56       ` Vasili Pupkin
2019-12-10 22:09         ` Jason A. Donenfeld
2019-12-10 22:27           ` Vasili Pupkin
2019-12-12 11:21             ` Jason A. Donenfeld
2019-12-10 17:31 ` Vasili Pupkin
2019-12-10 17:38   ` Jason A. Donenfeld [this message]

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='CAHmME9pBZoHh+D5+EL6yDXJWqrDOm91bXocH3=8ztCsX489-qw@mail.gmail.com' \
    --to=jason@zx2c4.com \
    --cc=diggest@gmail.com \
    --cc=jwollrath@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).