Skip to content

netmap support for nftables

Pablo Neira Ayuso netfilter-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5netfilter: nf_tables: allow up to 64 bytes in the set element data areainclude/net/netfilter/nf_tables.h net/netfilter/nf_tables_api.c+30 -120 replies
2/5netfilter: nft_nat: return EOPNOTSUPP if type or flags are not supportednet/netfilter/nft_nat.c+2 -20 replies
3/5netfilter: nft_nat: set flags from initialization pathnet/netfilter/nft_nat.c+6 -40 replies
4/5netfilter: nft_nat: add helper function to set up NAT address and protocolnet/netfilter/nft_nat.c+34 -220 replies
5/5netfilter: nft_nat: add netmap supportinclude/uapi/linux/netfilter/nf_nat.h net/netfilter/nft_nat.c+48 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH nf-next 0/5] netmap support for nftables

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