From: Florian Westphal <fw@strlen.de>
To: Daniel Huhardeaux <tech@tootai.net>
Cc: Netfilter list <netfilter-devel@vger.kernel.org>
Subject: Re: Nat redirect using map
Date: Thu, 31 Oct 2019 20:12:19 +0100 [thread overview]
Message-ID: <20191031191219.GL876@breakpoint.cc> (raw)
In-Reply-To: <6ea6ecb5-99c5-5519-b689-8e1291df69cc@tootai.net>
Daniel Huhardeaux <tech@tootai.net> wrote:
> Hi,
>
> I have a map like this
>
> map redirect_tcp {
> type inet_service : inet_service
> flags interval
> elements = { 12345 : 12345, 36025 : smtp }
> }
>
> and want to use nat redirect but it fail with unexpecting to, expecting EOF
> or semicolon. Here is the rule
>
> nft add rule ip nat prerouting iif eth0 tcp dport map @redirect_tcp redirect
> to @redirect_tcp
This should work:
nft add rule ip nat prerouting iif eth0 ip protocol tcp redirect to : tcp dport map @redirect_tcp
> Other: when using dnat for forwarding, should I take care of forward rules ?
>
> Example for this kind of rule from wiki:
>
> nft add rule nat prerouting iif eth0 tcp dport { 80, 443 } dnat
> 192.168.1.120
You mean auto-accept dnatted connections? Try "ct status dnat accept"
next prev parent reply other threads:[~2019-10-31 19:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-31 18:48 Nat redirect using map Daniel Huhardeaux
2019-10-31 19:12 ` Florian Westphal [this message]
2019-11-01 15:11 ` Daniel Huhardeaux
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=20191031191219.GL876@breakpoint.cc \
--to=fw@strlen.de \
--cc=netfilter-devel@vger.kernel.org \
--cc=tech@tootai.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.