diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2020-04-24 21:56:51 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2020-04-28 17:32:35 +0200 |
commit | 35a6b10c1bc488ca195e9c641563c29251f725f3 (patch) | |
tree | 60e24b067eb7658e3b7f355eb268b0732f80af22 /src/statement.c | |
parent | c2da6d7774aa9c2629d168f6d27be7797970d7a2 (diff) |
src: add netmap support
This patch allows you to specify an interval of IP address in maps.
table ip x {
chain y {
type nat hook postrouting priority srcnat; policy accept;
snat ip prefix to ip saddr map { 10.141.11.0/24 : 192.168.2.0/24 }
}
}
The example above performs SNAT to packets that comes from
10.141.11.0/24 using the prefix 192.168.2.0/24, e.g. 10.141.11.4 is
mangled to 192.168.2.4.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/statement.c')
-rw-r--r-- | src/statement.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/statement.c b/src/statement.c index 5bbc0540..8a1cd6e0 100644 --- a/src/statement.c +++ b/src/statement.c @@ -609,6 +609,8 @@ static void nat_stmt_print(const struct stmt *stmt, struct output_ctx *octx) if (stmt->nat.ipportmap) nft_print(octx, " addr . port"); + else if (stmt->nat.type_flags & STMT_NAT_F_PREFIX) + nft_print(octx, " prefix"); else if (stmt->nat.type_flags & STMT_NAT_F_INTERVAL) nft_print(octx, " interval"); |