linux系统中防火墙策略管理工具firewalld
作者:互联网
firewalld是什么?
和iptables一样,firewalld也是一种防火墙策略管理工具,用于设定防火墙策略。
和iptables相比,firewalld的显著特征是什么?
firewalld引入了区域的概念。firewalld可以使用CLI命令行和GUI图形用户界面来设定防火墙策略。
区域是什么?
区域就是预先设定好的防火墙策略模版,firewalld可以实现防火墙策略模版的快速切换。
firewalld 命令行(CLI)界面设定防火墙策略,即使用firewall-cmd命令行来设置,firewall-cmd都是使用“长格式”实现防火墙策略的设置
1、如何查询当前默认的区域名称 ?
[root@PC1linuxprobe test1]# firewall-cmd --get-default-zone ## 默认的区域为public public
2、都有哪些可以的区域 ?
[root@PC1linuxprobe test1]# firewall-cmd --get-zones block dmz drop external home internal public trusted work [root@PC1linuxprobe test1]# firewall-cmd --get-zones | xargs -n 1 block dmz drop external home internal public trusted work
3、如何显示当前正在使用的区域及网卡名称
[root@PC1linuxprobe test1]# firewall-cmd --get-active-zones public interfaces: eno16777728
4、预先定义的服务有哪些?
[root@PC1linuxprobe test1]# firewall-cmd --get-services amanda-client bacula bacula-client dhcp dhcpv6 dhcpv6-client dns ftp high-availability http https imaps ipp ipp-client ipsec kerberos kpasswd ldap ldaps libvirt libvirt-tls mdns mountd ms-wbt mysql nfs ntp openvpn pmcd pmproxy pmwebapi pmwebapis pop3s postgresql proxy-dhcp radius rpc-bind samba samba-client smtp ssh telnet tftp tftp-client transmission-client vnc-server wbem-https
5、显示当前区域的网卡配置参数、资源、端口及服务信息
[root@PC1linuxprobe test1]# firewall-cmd --list-all public (default, active) interfaces: eno16777728 sources: services: dhcpv6-client ssh ports: masquerade: no forward-ports: icmp-blocks: rich rules:
6、显示所有区域的网卡配置参数、资源、端口及服务信息
[root@PC1linuxprobe test1]# firewall-cmd --list-all-zones | wc -l 90 [root@PC1linuxprobe test1]# firewall-cmd --list-all-zones | head block interfaces: sources: services: ports: masquerade: no forward-ports: icmp-blocks: rich rules: [root@PC1linuxprobe test1]# firewall-cmd --list-all-zones | tail work interfaces: sources: services: dhcpv6-client ipp-client ssh ports: masquerade: no forward-ports: icmp-blocks: rich rules:
标签:test1,firewall,cmd,firewalld,PC1linuxprobe,--,client,linux,策略管理 来源: https://www.cnblogs.com/liujiaxin2018/p/13936324.html