当前位置: 主机百科 » 资源 » 技术 » 正文

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

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

查询防火墙状态:

1
  [root@localhost ~]# service iptables status

停止防火墙

1
  [root@localhost ~]# service iptables stop

启动防火墙

1
  [root@localhost ~]# service iptables start

重启防火墙

1
  [root@localhost ~]# service iptables restart

关闭防火墙

1
  [root@localhost ~]# chkconfig iptables off

启用防火墙

1
  [root@localhost ~]# chkconfig iptables on

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

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

未经允许不得转载:主机百科 » CentOS下iptables防火墙基本操作教程

相关文章