linux(centos7)firewalld-cmd查看防火墙状态以及查看当前规则

2021-01-22 15:30 来源:未知 作者:mas 责编:mas

linux(centos7)firewalld-cmd查看防火墙状态以及查看当前规则

查看防火墙状态:
 
[root@localhost ~]# firewall-cmd --state

running

[root@localhost ~]# 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 Wed 2020-03-11 11:32:21 CST; 1min 30s ago

     Docs: man:firewalld(1)

 Main PID: 3353 (firewalld)

   CGroup: /system.slice/firewalld.service

           └─3353 /usr/bin/python2 -Es /usr/sbin/firewalld --nofork --nopid



Mar 11 11:32:16 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...

Mar 11 11:32:21 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.

查看当前规则:

firewalld uses zones to manage the traffic. If a zone is not specified by the --zone option, the command is effective in the default zone assigned to the active network interface and connection.To list all the relevant information for the default zone:

[root@localhost ~]# firewall-cmd --list-all --zone public

public (active)

  target: default

  icmp-block-inversion: no

  interfaces: ens33

  sources:

  services: dhcpv6-client http https ssh

  ports: 3306/tcp 443/tcp

  protocols:

  masquerade: no

  forward-ports:

  source-ports:

  icmp-blocks:

  rich rules:

For example, to see which services are allowed in the current zone:



[root@localhost ~]# firewall-cmd --list-services

dhcpv6-client http https ssh

[root@localhost ~]#

 

【版权声明】本站部分内容来源于互联网,本站不拥有所有权,如果发现本站有侵权的内容,欢迎发送邮件至 benumon@163.com 举报,并提供相关证据,一经查实,本站将立刻删除涉嫌侵权内容。

分享:

更多文章

相关文章

关键词:

思韵闪耀,一生受益,思韵科技旗下专业IT技术社区 - 爱编程,爱源码,爱技术,一生受益。

powerby 思韵闪耀    豫ICP备13002912号-2