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 (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...