由于我在路由器配置方面遇到问题,所以我在这里询问了 nftables 中配置路由功能的最低必要配置是什么。由于问题解决了,我删除了它不再重要的描述,但对于完全开放的路由器来说,拥有这个最低配置可能会很有趣。不建议这样做,显然,这只是为了了解最低限度的必要性。来自 eth0)。
我试图使代码尽可能简单,任何东西都是开放的:
flush ruleset
table ip nat {
chain prerouting {
type nat hook prerouting priority 0; policy accept;
}
chain postrouting {
type nat hook postrouting priority 100; policy accept;
oifname "eth0" masquerade comment "outgoing NAT"
}
}
table ip filter {
chain input {
type filter hook input priority 0; policy accept;
}
chain forward {
type filter hook forward priority 0; policy accept;
}
chain output {
type filter hook output priority 0; policy accept;
}
}