0

我正在尝试在我的路由器中为 IPv6 添加 SNAT NFT 规则。通过接口 enp1s0 的任何传出数据包都应使用以下 IPv6 地址进行 SNAT。这些是我尝试过的规则和错误。

nft add rule inet nat postrouting oifname "enp1s0" snat ip6 to 2401:fb00:0:1ff::32d/64

错误:无法处理规则:没有这样的文件或目录添加规则 inet nat postrouting oifname enp1s0 snat ip6 to 2401:fb00:0:1ff::32d/64 ^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^

nft 添加规则 nat 后路由 oifname "enp1s0" snat 到 2401:fb00:0:1ff::32d

错误:无法解析主机名:不支持主机名的地址系列将规则 nat 后路由 oifname enp1s0 snat 添加到 2401:fb00:0:1ff::32d ^^^^^^^^^^^^^^^^^^ ^

nft 添加规则 nat 后路由 ip6 oifname enp1s0 snat 到 2401:fb00:0:1ff::32d

错误:语法错误,意外的 oifname 添加规则 nat postrouting ip6 oifname enp1s0 snat to 2401:fb00:0:1ff::32d ^^^^^^^

这些是我得到的问题。任何帮助,将不胜感激。

4

1 回答 1

0

你可以试试:

nft add rule ip6 nat postrouting meta oifname enp1s0 snat to 2401:fb00:0:1ff::32d

参考:10 分钟内快速参考-nftables

于 2021-11-19T07:41:22.510 回答