From: "Mucha Marcin (Sieciuch.com)" <m.mucha@sieciuch.com>
To: Florian Westphal <fw@strlen.de>
Cc: netfilter@vger.kernel.org
Subject: Re: nftables 1.0.6: snat with maps
Date: Wed, 02 Aug 2023 13:54:00 +0200 [thread overview]
Message-ID: <a6ea4a1156cf77ab8a236f08679483a6@sieciuch.com> (raw)
In-Reply-To: <20230802111030.GA27982@breakpoint.cc>
W dniu 2023-08-02 13:10, Florian Westphal napisał(a):
> Mucha Marcin, Sieciuch.com <m.mucha@sieciuch.com> wrote:
>> Hello,
>> I'm having trouble with moving from these snat rules:
>>
>> chain source-nat {
>> type nat hook postrouting priority 100; policy accept;
>> ct state invalid drop;
>> ip saddr 10.0.0.0/24 oif enp7s0 snat to 192.168.10.8
>> persistent;
>> ip saddr 10.1.0.0/24 oif enp7s0 snat to 192.168.10.9
>> persistent;
>> }
>> to the one that uses maps based on
>> https://wiki.nftables.org/wiki-nftables/index.php/Multiple_NATs_using_nftables_maps
>> :
>>
>> chain source-nat {
>> type nat hook postrouting priority 100; policy accept;
>> ct state invalid drop;
>> oif enp7s0 ip saddr maps {10.0.0.0/24 : 192.168.10.8,
>> 10.1.0.0/24 :
>> 192.168.10.9};
>> }
>>
>> My problem is - I'm getting syntax error after checking config with
>> "nft -cf
>> /etc/nftables.conf":
>> "/etc/nftables.conf:43:83-83: Error: syntax error, unexpected newline
>> oif enp7s0 ip saddr maps {10.0.0.0/24 : 192.168.10.8, 10.1.0.0/24
>> :
>> 192.168.10.9};
>> ^"
>> Could I ask you for a help?
>
> Did you mean
> oif enp7s0 snat to ip saddr map {10.0.0.0/24 : 192.168.10.8,
> 10.1.0.0/24 : 192.168.10.9 }
> ?
Thank you, now I understand my mistake.
next prev parent reply other threads:[~2023-08-02 11:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-02 10:45 nftables 1.0.6: snat with maps Mucha Marcin, Sieciuch.com
2023-08-02 11:10 ` Florian Westphal
2023-08-02 11:54 ` Mucha Marcin (Sieciuch.com) [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-08-02 10:17 Mucha Marcin, Sieciuch.com
2023-08-02 14:36 ` Eric
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=a6ea4a1156cf77ab8a236f08679483a6@sieciuch.com \
--to=m.mucha@sieciuch.com \
--cc=fw@strlen.de \
--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