跳转到内容
彼岸论坛
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[OpenWrt] 23.05 在构建固件时,还能用回 iptables 么, nftables 感觉有些不太好用


小天管理

已推荐帖子

在 menuconfig 里,似乎已经没有 iptables 能选了,openwrt 的 nftable 不知道是版本精简还是我自己语法问题..

root@openwrt:~# nft add table trouter
root@openwrt:~# 
root@openwrt:~# 
root@openwrt:~# 
root@openwrt:~# nft add chain trouter icmp_filter { type filter hook input priority 0 \; }
root@openwrt:~# nft add rule trouter icmp_filter iifname "eth0" icmp type echo-request drop
root@openwrt:~# 
root@openwrt:~# 
root@openwrt:~# nft add rule trouter icmp_filter iifname "br-lan" icmp type echo-request drop
root@openwrt:~# 
root@openwrt:~# 
root@openwrt:~# nft add rule trouter input iifname { "eth0", "br-lan" } icmp type echo-request counter jump icmp_filter
Error: Could not process rule: No such file or directory
add rule trouter input iifname { eth0, br-lan } icmp type echo-request counter jump icmp_filter
                 ^^^^^
root@openwrt:~# 
root@openwrt:~# nft add rule trouter input iifname eth0,br-lan icmp type echo-request counter jump icmp_filter
Error: Basetype of type network interface name is not bitmask
add rule trouter input iifname eth0,br-lan icmp type echo-request counter jump icmp_filter
                               ^^^^
root@openwrt:~# 
root@openwrt:~# nft add rule trouter input iifname { eth0, br-lan } icmp type echo-request counter jump icmp_filter
Error: Could not process rule: No such file or directory
add rule trouter input iifname { eth0, br-lan } icmp type echo-request counter jump icmp_filter
                 ^^^^^
root@openwrt:~# 
root@openwrt:~# 

要是 iptables ,这事情早结束了。。。。

意见的链接
分享到其他网站

加入讨论

您现在可以发表并稍后注册. 如果您是会员,请现在登录来参与讨论.

游客
回复主题...

×   粘贴为富文本.   粘贴为纯文本来代替

  只允许使用75个表情符号.

×   您的链接已自动嵌入.   显示为链接来代替

×   您之前的内容已恢复.   清除编辑器

×   您无法直接粘贴图片.要从网址上传或插入图片.

  • 游客注册

    游客注册

  • 会员

    没有会员可显示

  • 最新的状态更新

    没有最新的状态更新
  • 最近查看

    • 没有会员查看此页面.
×
×
  • 创建新的...