iptables: No chain/target/match by that name.
·
iptables运行报错,解决思路
iptables: No chain/target/match by that name.
现象
执行命令例如:
# iptables -t filter -A INPUT -s 10.6.0.89 -m comment --comment "temp rule" -j ACCEPT
iptables: No chain/target/match by that name.
思路
命令中的-m意义为:该选项用于指定扩展模块,即匹配器模块或目标器模块。通过“-m”选项,可以使用Linux内核提供的一系列扩展模块,增强iptables的功能。
同时iptables所有功能的实现是依赖于内核模块的,那么可以得出结论:内核不支持该扩展模块,把它添加进去即可。
解决
内核中make menuconfig打开如下模块:
Networking support
Networking options --->
[*] Network packet filtering framework (Netfilter) --->
Core Netfilter Configuration --->
<*> Netfilter connection tracking support
-*- Netfilter Xtables support (required for ip_tables)
<*> "comment" match support
编译,烧写内核即可。
同理,如果-m别的选项,出现上述报错时,在内核中的
*** Xtables matches ***栏中选择对应的match supprot即可。
AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。
更多推荐


所有评论(0)