When creating a dnat rule, you can specify the following command:
nft 'add rule ip twilight prerouting ip daddr 1.2.3.0/24 dnat ip prefix to ip daddr map { 1.2.3.0/24 : 2.3.4.0/24 }'
And then get dnat that maps addresses like 1.2.3.4 -> 2.3.4.4. This command runs as expected with nftables v1.0.4 (Lester Gooch #3), and according to the answer here.
If I try to do the same with ipv6, using the following commands:
nft 'add rule ip6 twilight prerouting ip6 daddr aa:bb:cc:dd::/64 dnat ip6 prefix to ip6 daddr map { [aa:bb:cc:dd::]/64 : [bb:cc:dd:ee::]/64 }'
nft 'add rule ip6 twilight prerouting ip6 daddr aa:bb:cc:dd::/64 dnat ip6 prefix to ip6 daddr map { aa:bb:cc:dd::/64 : bb:cc:dd:ee::/64 }'
nft 'add rule ip6 twilight prerouting ip6 daddr aa:bb:cc:dd::/64 dnat ip6 prefix to ip6 daddr map { "aa:bb:cc:dd::/64" : "bb:cc:dd:ee::/64" }'
Then, I get the following error messages:
Error: syntax error, unexpected newline
add rule ip6 twilight prerouting ip6 daddr aa:bb:cc:dd::/64 dnat ip6 prefix to ip6 daddr map { [aa:bb:cc:dd::]/64 : [bb:cc:dd:ee::]/64 }
^
Error: syntax error, unexpected newline
add rule ip6 twilight prerouting ip6 daddr aa:bb:cc:dd::/64 dnat ip6 prefix to ip6 daddr map { aa:bb:cc:dd::/64 : bb:cc:dd:ee::/64 }
^
Error: syntax error, unexpected newline
add rule ip6 twilight prerouting ip6 daddr aa:bb:cc:dd::/64 dnat ip6 prefix to ip6 daddr map { "aa:bb:cc:dd::/64" : "bb:cc:dd:ee::/64" }
^
Is there a way that I can make anonymous ipv6 maps in nftables?