美文网首页
Linux防火墙设置

Linux防火墙设置

作者: Mr_Gao_ | 来源:发表于2017-10-17 09:47 被阅读0次

    在CentOS7中,有很多CentOS 6中的常用服务发生了变化
    其中iptables是其中比较大的一个。防火墙iptables被firewalld取代

    centOS 7防火墙命令

    查看防火墙状态。 
    systemctl status firewalld
    
    临时关闭防火墙命令。重启电脑后,防火墙自动起来。 
    systemctl stop firewalld
    
    永久关闭防火墙命令。重启后,防火墙不会自动启动。 
    systemctl disable firewalld
    
    打开防火墙命令。 
    systemctl enable firewalld   
    

    centOS 6关闭防火墙

    #可以查看到iptables服务的当前状态
    service iptables status  
    
    #关于启动和关闭防火墙的命令:
    1) 重启后生效
    
    开启: chkconfig iptables on
    
    关闭: chkconfig iptables off
    
    2) 即时生效,重启后失效
    
    开启: service iptables start
    
    关闭: service iptables stop 
    

    相关文章

      网友评论

          本文标题:Linux防火墙设置

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