如何解决Nftables:如何启用路由器从 wlan 到 wan
我需要将我的笔记本电脑用作路由器,因此我需要将 wlan 连接到 wifi 互联网连接并将其转发到我启用了 dhcp 服务器的 eth (...);我正在使用 Debian Bullseye,我用这个替换了旧的 nftables.conf
:
#!/usr/sbin/nft -f
flush ruleset
table inet lantowlan {
# allow all packets sent by the machine itself
chain output {
type filter hook output priority 100; policy accept;
}
# allow LAN to WLAN,disallow WLAN to LAN
chain input {
type filter hook input priority 0; policy accept;
iif "enp0s25" accept
iif "wlp3s0" drop
}
# allow packets from LAN to WLAN,and WLAN to LAN if LAN initiated the connection
chain forward {
type filter hook forward priority 0; policy drop;
iif "enp0s25" oif "wlp3s0" accept
iif "wlp3s0" oif "enp0s25" ct state related,established accept
}
}
我想知道“代码”是否正确,以及如何用 nftables 替换 iptables,因为我认为这是另一个问题...
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。