Linux-CentOS7-防火墙开启、关闭、以及查看防火墙状态命令

  • 查看防火墙状态
[root@os-one ~]# systemctl status firewalld
  • 如下表示防火墙开启中 active (running)
● firewalld.service - firewalld - dynamic firewall daemon
			  Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
			  Active: active (running) since 二 2019-03-26 13:00:19 CST; 1min 5s ago
			    Docs: man:firewalld(1)
			Main PID: 26048 (firewalld)
			  CGroup: /system.slice/firewalld.service
			          └─26048 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid
			
		3月 26 13:00:18 aubin.com systemd[1]: Starting firewalld - dynamic firewall daemon...
		3月 26 13:00:19 aubin.com systemd[1]: Started firewalld - dynamic firewall daemon.
  • 如下表示防火墙关闭中 inactive (dead)
● firewalld.service - firewalld - dynamic firewall daemon
			  Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
			  Active: inactive (dead) since 二 2019-03-26 13:03:22 CST; 2s ago
			    Docs: man:firewalld(1)
		  Process: 26048 ExecStart=/usr/sbin/firewalld --nofork --nopid $FIREWALLD_ARGS (code=exited, status=0/SUCCESS)
		 Main PID: 26048 (code=exited, status=0/SUCCESS)
		
		3月 26 13:00:18 aubin.com systemd[1]: Starting firewalld - dynamic firewall daemon...
		3月 26 13:00:19 aubin.com systemd[1]: Started firewalld - dynamic firewall daemon.
		3月 26 13:03:21 aubin.com systemd[1]: Stopping firewalld - dynamic firewall daemon...
		3月 26 13:03:22 aubin.com systemd[1]: Stopped firewalld - dynamic firewall daemon.
  • 开启防火墙
[root@os-one ~]# systemctl start firewalld
  • 关闭防火墙
[root@os-one ~]# systemctl stop firewalld
已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 精致技术 设计师:CSDN官方博客 返回首页