Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Stephen Satchell <list@satchell.net>
To: Linux Netfilter Users List <netfilter@vger.kernel.org>
Subject: iif versus meta fib iif
Date: Sun, 24 May 2020 15:06:47 -0700	[thread overview]
Message-ID: <f464fa81-93c2-62f4-9703-e84e35fb3d54@satchell.net> (raw)

I'm trying to understand why the nft(8) responds the way it does, and 
perhaps try to understand the underlying operation of a netfilter firewall.

What is the difference between these selectors?

1. iif eth0
2. meta fib saddr iif eth0
3. meta fib daddr iif eth0

4. oif eth0
5. meta fib saddr oif eth0
6. meta fib daddr oif eth0

(1) tests what interface came from, irrespective of the source and 
destination address

(2) uses the routing table to find out where the packet would return

(3) uses the routing table to find out where the packet will be routed

(4) tests the interface associated with the routing decision that has 
been performed in the packet flow.  In theory. (3), (4) and (6) would 
return the same result.

(5) uses the routing table to find out where the packet would return

(6) uses the routing table to find out where the packet would be routed. 
  In theory, (4) and (6) would return the same result.

===
https://wiki.nftables.org/wiki-nftables/index.php/Netfilter_hooks

So here is the big question:  how can I determine the FIB's 
classification of the source address in rules in the output and 
postrouting tables?  In other words, how can I test that the source 
address denotes a uni-cast address that would return to this router?

The documentation is silent about restrictions on using the routing 
selectors.

I can understand why "oif eth0" is not permitted in ingress, prerouting 
and input tables, because the output routing decision hasn't been made yet.

The packet routing decision *has* been made in the forward, output, and 
postrouting table, so "oif eth0" should be allowed.



             reply	other threads:[~2020-05-24 22:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-24 22:06 Stephen Satchell [this message]
2020-05-24 22:42 ` iif versus meta fib iif Florian Westphal

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=f464fa81-93c2-62f4-9703-e84e35fb3d54@satchell.net \
    --to=list@satchell.net \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox