iptables 错误:“没有该名称的链/目标/匹配。”

iptables 错误:“没有该名称的链/目标/匹配。”

尝试通过向 iptables 添加此规则来阻止某个 http/https URL 请求访问服务器:

iptables -I INPUT 1 -p tcp -m multiport --destination-ports 80,443 -m string --string "my_string" --algo bm -j DROP

这将返回以下错误:No chain/target/match by that name

我可以毫无问题地向 INPUT 链添加其他规则。我相信我已经将罪魁祸首确定为字符串模块,但对我来说语法看起来没问题。

答案1

如果您想在 openvz vps 上正确设置 iptables,需要考虑一些具体事项,请查看官方 openvz wiki:http://wiki.openvz.org/Setting_up_an_iptables_firewall

相关内容