Linux Netfilter development
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Subject: [PATCH nf-next 0/5] netmap support for nftables
Date: Fri, 24 Apr 2020 21:55:32 +0200	[thread overview]
Message-ID: <20200424195537.23975-1-pablo@netfilter.org> (raw)

Hi,

The following patchset adds netmap support for nftables.

Patch #1 Remove the 128-bit limitation on the set element data area.
         Rise it up to 64 bytes maximum.

Patch #2 Return EOPNOTSUPP in case NAT type or flags are not supported.

Patch #3 Initialize NAT flags from control plane.

Patch #4 Add helper functions to set up NAT address and protocol

Patch #5 Add netmap support.

The following example enables source netmap using the 192.168.3.0/24
network address:

 table ip x {
            chain y {
                    type nat hook postrouting priority srcnat; policy accept;
                    snat ip prefix to 192.168.3.0/24
            }
 }

You can also combine it with maps:

 table ip x {
            chain y {
                    type nat hook postrouting priority srcnat; policy accept;
                    snat ip prefix to ip saddr map { 192.168.2.0/24 : 192.168.3.0/24 }
            }
 }

Comments welcome.

Thanks.

Pablo Neira Ayuso (5):
  netfilter: nf_tables: allow up to 64 bytes in the set element data area
  netfilter: nft_nat: return EOPNOTSUPP if type or flags are not supported
  netfilter: nft_nat: set flags from initialization path
  netfilter: nft_nat: add helper function to set up NAT address and protocol
  netfilter: nft_nat: add netmap support

 include/net/netfilter/nf_tables.h     |   4 +
 include/uapi/linux/netfilter/nf_nat.h |   4 +-
 net/netfilter/nf_tables_api.c         |  38 ++++++---
 net/netfilter/nft_nat.c               | 110 ++++++++++++++++++++------
 4 files changed, 117 insertions(+), 39 deletions(-)

--
2.20.1


             reply	other threads:[~2020-04-24 19:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-24 19:55 Pablo Neira Ayuso [this message]
2020-04-24 19:55 ` [PATCH nf-next 1/5] netfilter: nf_tables: allow up to 64 bytes in the set element data area Pablo Neira Ayuso
2020-04-24 19:55 ` [PATCH nf-next 2/5] netfilter: nft_nat: return EOPNOTSUPP if type or flags are not supported Pablo Neira Ayuso
2020-04-24 19:55 ` [PATCH nf-next 3/5] netfilter: nft_nat: set flags from initialization path Pablo Neira Ayuso
2020-04-24 19:55 ` [PATCH nf-next 4/5] netfilter: nft_nat: add helper function to set up NAT address and protocol Pablo Neira Ayuso
2020-04-24 19:55 ` [PATCH nf-next 5/5] netfilter: nft_nat: add netmap support Pablo Neira Ayuso

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=20200424195537.23975-1-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=netfilter-devel@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