小编Tom*_*ato的帖子

使用 nftables 查看 NAT 连接

如何使用 nftables 跟踪 nat 传出连接。只需要查看 nat 统计信息,即或多或少使用了哪些输出地址。

root@nat-1:~# nft list table nat
table ip nat {
    chain post {
            type nat hook postrouting priority 100; policy accept;
            ip saddr 10.0.0.0/8 oif "bond0.926" snat to 19.246.159.1-19.246.159.7
    }

    chain pre {
            type nat hook prerouting priority -100; policy accept;
    }
}
Run Code Online (Sandbox Code Playgroud)

netstat-nat 适用于 iptables,但不再适用于 nftables。

netstat-nat -S
Could not read info about connections from the kernel, make sure netfilter is enabled in kernel or by modules.
Run Code Online (Sandbox Code Playgroud)

我当然可以使用 tcpdump,但应该有一些更好的实用程序;-)

nat nftables

4
推荐指数
1
解决办法
7417
查看次数

标签 统计

nat ×1

nftables ×1