国内外VPS
主机测评与优惠

CentOS下iptables防火墙基本操作教程

CentOS下iptables防火墙的基本操作命令:

查询防火墙状态:

  [root@localhost ~]# service iptables status

停止防火墙

  [root@localhost ~]# service iptables stop

启动防火墙

  [root@localhost ~]# service iptables start

重启防火墙

  [root@localhost ~]# service iptables restart

关闭防火墙

  [root@localhost ~]# chkconfig iptables off

启用防火墙

  [root@localhost ~]# chkconfig iptables on

示例:配置iptables,打开80端口。

  [root@localhost ~]# iptables -I INPUT -p tcp --dport 80 -j ACCEPT  [root@localhost ~]# service iptables save

赞(0)
版权声明:本文采用知识共享 署名4.0国际许可协议 [BY-NC-SA] 进行授权
文章名称:《CentOS下iptables防火墙基本操作教程》
文章链接:https://www.liuzhanwu.com/3040.html
本站资源仅供个人学习交流,请于下载后24小时内删除,不允许用于商业用途,否则法律问题自行承担。

登录

找回密码

注册