主机百科
测评与优惠

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

赞(0)
未经允许不得转载:主机阁 » CentOS下iptables防火墙基本操作教程

登录

找回密码

注册