using sets as snat targets in nat tables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
I'm trying to use a set as a snat target and failing. This is my config:

table ip nat { # handle 73
set dc-cidr-nat { # handle 3
type ipv4_addr
flags interval
elements = { <internal-network> }
}

set external-ip-net { # handle 4
type ipv4_addr
elements = { <public-ip> }
}

chain POSTROUTING { # handle 1
type nat hook postrouting priority srcnat; policy accept;
ip saddr @dc-cidr-nat oif "enp1s0f0" snat to @external-ip-net comment
"internet gateway" # handle 7
}

This fails wtth "Error: syntax error, unexpected string, expecting ll
or nh or th". Using an anonymous set doesn't work either, but hard
coding the <external-ip> does. I can't find any hint in the wiki if
sets are allowed in this context.

OS: Linux version 5.4.0-107-generic (buildd@lcy02-amd64-058) (gcc
version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1))
nftables version: v0.9.3 (Topsy)



[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux