在 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 ,这事情早结束了。。。。
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.