netfilter.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Glen Huang <heyhgl@gmail.com>
To: netfilter@vger.kernel.org
Subject: Possible to check if ip daddr belongs to an interface in the prerouting chain?
Date: Fri, 28 Apr 2023 11:58:51 +0800	[thread overview]
Message-ID: <D797AC4D-8B12-4F80-8C82-1591C3658D0B@gmail.com> (raw)

Hi,

I use tproxy to redirect all traffic from the lan interface, but I want to exemplify traffic whose destination IP belongs to the wan interface. I wonder if it’s possible to specify if ip daddr matches the wan interface IP in the prerouting chain?

The only solution I can think of right now, is to create a set, and manually update the set with wan IPs (also whenever they change), which is very cumbersome. 

I wonder if there is a direct way to that in nft?

I use nft1.0.7 with kernel 5.15.108

             reply	other threads:[~2023-04-28  3:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-28  3:58 Glen Huang [this message]
2023-04-28  7:22 ` Possible to check if ip daddr belongs to an interface in the prerouting chain? seentr
2023-04-28  7:53   ` Glen Huang
2023-04-28  8:03     ` seentr
2023-04-28  8:59       ` Glen Huang
2023-04-28 10:05         ` Serg
2023-04-29  5:44           ` Glen Huang
2023-04-29  8:26             ` Kerin Millar
2023-04-29  8:49               ` Glen Huang
2023-04-29  8:57                 ` Kerin Millar
2023-04-30 11:54                   ` Glen Huang
2023-04-30 19:09                     ` Kerin Millar
2023-05-04  2:55                       ` Glen Huang

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=D797AC4D-8B12-4F80-8C82-1591C3658D0B@gmail.com \
    --to=heyhgl@gmail.com \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).