美文网首页
通过iptables限制端口

通过iptables限制端口

作者: 十野早望 | 来源:发表于2017-12-06 22:59 被阅读0次

以下介绍的方法在linux下使用,很简便。

开端口为:

iptables -A INPUT -p   $port   -j ACCEPT

关端口把ACCEPT改为DROP即可,即:

iptables -A INPUT -p $port   -j DROP

其中$port即为端口数字

当然,暴力一点可以service iptables stop && chkconfig iptables off

相关文章

网友评论

      本文标题:通过iptables限制端口

      本文链接:https://www.haomeiwen.com/subject/bfrrixtx.html