Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Michael Weiser <michael@weiser.dinsnail.net>
To: Pascal Hambourg <pascal@plouf.fr.eu.org>
Cc: netfilter@vger.kernel.org
Subject: Re: Match packet address against addresses on interface
Date: Sun, 12 Feb 2017 15:07:47 +0100	[thread overview]
Message-ID: <20170212140747.GA4010@weiser.dinsnail.net> (raw)
In-Reply-To: <e5f7689a-6c5f-1f28-5680-4fcca061b3f9@plouf.fr.eu.org>

Hi Pascal,

On Sun, Feb 12, 2017 at 02:15:49PM +0100, Pascal Hambourg wrote:
> > iptables -I OUTPUT 1 -p tcp --dport 22 -m addrtype --src-type LOCAL -j ACCEPT
> I thought you wanted to match only against local addresses attached to a
> specific interface, not all interfaces. If that specific interface is the
> output interface, then you can add --limit-iface-out.

Agreed.

> Otherwise, may I ask why do you need this ?
> Only a process with special privileges can send packets with a non local
> address.

My use case is a DMZ bastion/remote access jump (i.e. somewhat exposed)
host where I do not want a process that somehow gained privileges to be
able to e.g. send out spoofed packets right away as well as a kind of
high-level martian filtering by just accepting packets directed at an
address the machine actually has. This collides with IPv6 constantly
changing addresses due to privacy extensions and RAs from my DSL
provider. 

I am aware that it mostly is a case of "rampant paranoia"[tm] paired
with "because I can"[tm].

> local != private
> There is no need for a specific extension to match any given address prefix
> such as those defined in RFC1918 : -d/-s already do the job.

I did say dummy, didn't I? :)
-- 
bye, Michael
Dessau fuer's Volk!

      reply	other threads:[~2017-02-12 14:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-11 17:13 Match packet address against addresses on interface Michael Weiser
2017-02-12  8:59 ` Pascal Hambourg
2017-02-12 12:43   ` Michael Weiser
2017-02-12 13:15     ` Pascal Hambourg
2017-02-12 14:07       ` Michael Weiser [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=20170212140747.GA4010@weiser.dinsnail.net \
    --to=michael@weiser.dinsnail.net \
    --cc=netfilter@vger.kernel.org \
    --cc=pascal@plouf.fr.eu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox