美文网首页
[rhel7] 2. 关闭防火墙

[rhel7] 2. 关闭防火墙

作者: 飞跑的蛤蟆 | 来源:发表于2017-03-21 22:15 被阅读372次
    • 关闭防火墙,并设置开机自动关闭
    1. 查看防火墙服务运行状态
    [root@localhost network-scripts]# # 查看服务运行状态
    [root@localhost network-scripts]# systemctl status firewalld
    ● firewalld.service - firewalld - dynamic firewall daemon
       Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
       Active: active (running) since 五 2017-03-10 20:47:38 CST; 37min ago
     Main PID: 1071 (firewalld)
       CGroup: /system.slice/firewalld.service
               └─1071 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid
    
    3月 10 20:47:32 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
    3月 10 20:47:38 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.
    
    • 临时关闭防火墙,重启后丢失。
    [root@localhost network-scripts]# systemctl stop firewalld
    [root@localhost network-scripts]# systemctl status firewalld
    ● firewalld.service - firewalld - dynamic firewall daemon
       Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
       Active: inactive (dead) since 五 2017-03-10 21:31:04 CST; 23s ago
      Process: 1071 ExecStart=/usr/sbin/firewalld --nofork --nopid $FIREWALLD_ARGS (code=exited, status=0/SUCCESS)
     Main PID: 1071 (code=exited, status=0/SUCCESS)
    
    3月 10 20:47:32 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
    3月 10 20:47:38 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.
    3月 10 21:31:02 localhost.localdomain systemd[1]: Stopping firewalld - dynamic firewall daemon...
    3月 10 21:31:04 localhost.localdomain systemd[1]: Stopped firewalld - dynamic firewall daemon.
    
    • 为了验证,重启一下试试
      重启命令reboot 或者 init 6
    [root@localhost weibo]#  systemctl status firewalld
    ● firewalld.service - firewalld - dynamic firewall daemon
       Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
       Active: active (running) since 五 2017-03-10 21:54:06 CST; 1min 53s ago
     Main PID: 1031 (firewalld)
       CGroup: /system.slice/firewalld.service
               └─1031 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid
    
    3月 10 21:53:56 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
    3月 10 21:54:06 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.
    
    

    果然还有

    • 关闭防火墙,开机自动关闭
    [root@localhost weibo] # systemctl disable firewalld
    Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
    Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.
    
    

    重启系统,看看是否真正的关闭了

    [root@localhost weibo]# systemctl status firewalld
    ● firewalld.service - firewalld - dynamic firewall daemon
       Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
       Active: inactive (dead)
    

    真的关闭了

    相关文章

      网友评论

          本文标题:[rhel7] 2. 关闭防火墙

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