问题描述
我需要将我的笔记本电脑用作路由器,因此我需要将 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 (将#修改为@)