前言
柳河ssl適用于網(wǎng)站、小程序/APP、API接口等需要進(jìn)行數(shù)據(jù)傳輸應(yīng)用場(chǎng)景,ssl證書(shū)未來(lái)市場(chǎng)廣闊!成為成都創(chuàng)新互聯(lián)的ssl證書(shū)銷(xiāo)售渠道,可以享受市場(chǎng)價(jià)格4-6折優(yōu)惠!如果有意向歡迎電話(huà)聯(lián)系或者加微信:028-86922220(備注:SSL證書(shū)合作)期待與您的合作!
管理防火墻工具
1.圖形化管理工具 firewall-config
2.命令管理工具 iptables(操作復(fù)雜) firewall-cmd
iptables 只是linux防火墻管理工具而已,真正實(shí)現(xiàn)防火墻功能的是netfilter,我們配置了iptables規(guī)則后netfilter通過(guò)這些規(guī)則來(lái)進(jìn)行防火墻過(guò)濾等操作
netfilter模塊:
? 它是主要的工作模塊,位于內(nèi)核中,在網(wǎng)絡(luò)層的五個(gè)位置(也就是防火墻四表五鏈中的五鏈)注冊(cè)了一些函數(shù),用來(lái)抓取數(shù)據(jù)包;把數(shù)據(jù)包的信息拿出來(lái)匹配各個(gè)鏈位置在對(duì)應(yīng)表中的規(guī)則:匹配之后,進(jìn)行相應(yīng)的處理accept、drop等等。
下面這張圖很明了的說(shuō)明了netfilter和iptables之間的關(guān)系
只要有操作系統(tǒng),就有防火墻
accept 同意 drop 拒絕
網(wǎng)絡(luò)接口層從某種意義上是二層的mac
鏈就是執(zhí)行的步驟:共有五個(gè)
進(jìn)路由(prerouting)、
進(jìn)系統(tǒng)(input)、
轉(zhuǎn)發(fā)(forward)、
出系統(tǒng)(output)、
出路由(postrouting);
表就是存儲(chǔ)的規(guī)則:數(shù)據(jù)包到了該鏈處,會(huì)去對(duì)應(yīng)表中查詢(xún)?cè)O(shè)置的規(guī)則,然后決定是否放行、丟棄、轉(zhuǎn)發(fā)還是修改等等操作。
表——————鏈————規(guī)則
一個(gè)表——一個(gè)表當(dāng)中包含多個(gè)鏈——一個(gè)鏈當(dāng)中包含多個(gè)規(guī)則
進(jìn)路由、出路由 地址轉(zhuǎn)換時(shí)用
硬件防火墻效果大于軟件防火墻,軟件防火墻只是多一道防護(hù)
五鏈 | raw表(打標(biāo)記) | mangle表(修改數(shù)據(jù)包類(lèi)型) | nat表(地址轉(zhuǎn)換) | filter表(過(guò)濾數(shù)據(jù)包) |
---|---|---|---|---|
PREROUTING鏈(進(jìn)路由) | - | - | - | |
INPUT鏈(進(jìn)系統(tǒng)) | - | - | ||
FORWARD鏈(數(shù)據(jù)包轉(zhuǎn)發(fā)) | - | - | ||
OUTPUT鏈(出系統(tǒng)) | - | - | - | - |
POSTROUTING鏈(出路由) | - | - |
iptables [ -t 表名 ] 選項(xiàng) [ 鏈名 ] [ 條件 ] [ -j 控制類(lèi)型 ]
iptables 常用參數(shù)
-P 設(shè)置默認(rèn)策略:iptables
-P INPUT (DROP | ACCEPT)
-F 清空規(guī)則鏈
-L 查看規(guī)則鏈
-A 在規(guī)則連的末尾插入新的規(guī)則
-I num 在規(guī)則連的頭部加入新規(guī)則 //大寫(xiě)的i
-D num 刪除某一條規(guī)則
-s 匹配來(lái)源地址IP/MASK,加嘆號(hào)“!”表示除這個(gè)IP外
-d 匹配目標(biāo)地址
-i 網(wǎng)卡名稱(chēng) 匹配從這塊網(wǎng)卡流入的數(shù)據(jù)
-o 網(wǎng)卡名稱(chēng) 匹配從這塊網(wǎng)卡流出的數(shù)據(jù)
-p 匹配協(xié)議,如tcp,udp,icmp
--dport num 匹配目標(biāo)端口號(hào)
--sport num 匹配來(lái)源端口號(hào)
-I 規(guī)則鏈 -i網(wǎng)卡 -p 協(xié)議 --dport 目標(biāo)端口 -s 源地址 -j 操作
iptables -F 清空默認(rèn)的filters表
想要清空指定的表,需要-t指定表
通常防火墻的接口在兩個(gè)或者兩個(gè)以上,針對(duì)用途的不同可以將接口劃分為不同的區(qū)域,針對(duì)區(qū)域去進(jìn)行管理
? linux6與linux7 的網(wǎng)卡名稱(chēng)不同————linux6 的網(wǎng)卡名稱(chēng) eth0
區(qū)別 | linux6 | linux7 |
---|---|---|
網(wǎng)卡名稱(chēng) | eth0 | ens33 |
防火墻 | iptables | firewalld,iptables |
在防火墻中,發(fā)揮作用的是netfilter(內(nèi)核態(tài)),不可以直接管理,只能間接管理,使用firewalld或者iptabvles
daemon 指的是進(jìn)程
firewall-config 是圖形化工具
firewall-cmd 是字符命令
使用工具或者操作去管理進(jìn)程和服務(wù)
進(jìn)程服務(wù)去控制封裝的iptables命令,間接的去管理內(nèi)核中的netfiler
真正能跟netfilter交互的是iptables,firewall去管理iptables
四表五鏈也就在iptables(command)中
工作原理體系圖
區(qū)別 | firewalld | iptables |
---|---|---|
配置文件 | /usr/lib/firewalld/ /etc/firewalld | etc/firewalld/etc/sysconfig/iptables |
對(duì)規(guī)則的修改 | 不需要全部刷新策略,不丟失現(xiàn)行連接 | 需要全部刷新策略,丟失連接 |
防火墻類(lèi)型 | 動(dòng)態(tài)防火墻 | 靜態(tài)防火墻 |
區(qū)域 | 描述 |
---|---|
drop(丟棄) | 任何接收的網(wǎng)絡(luò)數(shù)據(jù)包都被丟棄,沒(méi)有任何回復(fù)。僅能有發(fā)送出去的網(wǎng)絡(luò)連接 |
block(限制) | 人和接受的網(wǎng)絡(luò)連接都被IPv4的imcp-host-prohibited 信息和IPv6的icmp6-adm-prohibited 信息所拒絕 |
public(公共) | 在公共區(qū)域內(nèi)使用,不能詳細(xì)網(wǎng)絡(luò)內(nèi)的其他計(jì)算機(jī)不會(huì)對(duì)您的計(jì)算機(jī)造成危害,只能接收經(jīng)過(guò)選取的內(nèi)容 |
external(外部) | 特別是為路由器啟用了偽裝功能的外部網(wǎng)。您不能信任來(lái)自網(wǎng)絡(luò)的其他計(jì)算機(jī),不能相信他們不會(huì)對(duì)您的計(jì)算機(jī)造成危害,只能接收經(jīng)過(guò)選擇的鏈接 |
dmz(非軍事區(qū)) | 用于您的非軍事區(qū)內(nèi)的電腦,此區(qū)域內(nèi)可公開(kāi)訪(fǎng)問(wèn),可以有限的進(jìn)入您的內(nèi)部網(wǎng)絡(luò),僅僅接收經(jīng)過(guò)選擇的鏈接 |
work(工作) | 用于工作區(qū)。您可以基本詳細(xì)網(wǎng)絡(luò)內(nèi)的其他電腦不會(huì)危害您的電腦。僅僅接收經(jīng)過(guò)選擇的鏈接 |
home(家庭) | 用于家庭網(wǎng)絡(luò)。您可以基本信任網(wǎng)絡(luò)內(nèi)的其他計(jì)算機(jī)不會(huì)危害您的計(jì)算機(jī)。僅僅接收經(jīng)過(guò)選擇的鏈接 |
internal(內(nèi)部) | 用于內(nèi)部網(wǎng)絡(luò)。您可以基本上信任網(wǎng)絡(luò)內(nèi)的其他計(jì)算機(jī)不會(huì)威脅您的計(jì)算機(jī)。僅僅接收經(jīng)過(guò)選擇的連接 |
trusted(信任) | 可接受所有的網(wǎng)絡(luò)連接 |
public 公共區(qū)域,默認(rèn)所有端口放在這個(gè)區(qū)域
默認(rèn)規(guī)則,高安全級(jí)別可以訪(fǎng)問(wèn)低安全級(jí)別,如果讓外網(wǎng)訪(fǎng)問(wèn)內(nèi)網(wǎng),需要專(zhuān)門(mén)修改規(guī)則
比如內(nèi)網(wǎng)的安全級(jí)別為100,外網(wǎng)的安全級(jí)別為0,則
內(nèi)網(wǎng)可以訪(fǎng)問(wèn)外網(wǎng),外網(wǎng)不可以訪(fǎng)問(wèn)內(nèi)網(wǎng)
把提供對(duì)外服務(wù)的服務(wù)器放到內(nèi)網(wǎng),如果想要讓外網(wǎng)可以訪(fǎng)問(wèn)內(nèi)網(wǎng),需要設(shè)置對(duì)應(yīng)的配置,但是安全性方面存在隱患
于是就出現(xiàn)了dmz(非軍事區(qū)),將dmz安全級(jí)別設(shè)置為50,將提供對(duì)外服務(wù)的服務(wù)器劃分到dmz,這樣安全性方面就得到了提高
但是這樣也有以dmz為跳板,去訪(fǎng)問(wèn)內(nèi)網(wǎng)的情況,為了更安全,背靠背堡壘主機(jī)的模式出現(xiàn),即再加入一臺(tái)硬件防火墻,將新的一臺(tái)防火墻放到內(nèi)網(wǎng)與當(dāng)前硬件防火墻之間,起到隔絕的作用
即,第一道防火墻擋在外面,后面分兩道線(xiàn),一道是對(duì)外服務(wù)器,一道是內(nèi)網(wǎng),在內(nèi)網(wǎng)的位置再添加第二道防火墻,以保護(hù)內(nèi)網(wǎng)主機(jī)安全
可以在第一道防火墻啟用流量監(jiān)控清晰,實(shí)時(shí)分析數(shù)據(jù),針對(duì)性去過(guò)濾可疑數(shù)據(jù),
還可以在第一道防火墻放置一個(gè)蜜罐
常用的區(qū)域?yàn)椋?/p>
public
external
dmz
internal
block 是阻塞模式
工作和家庭是自定義區(qū)域
低安全通向高安全需要設(shè)置入站規(guī)則
默認(rèn)情況下,ens33綁定在公共區(qū)域(public)中
iptables沒(méi)有區(qū)域的概念
iptables是針對(duì)四表五鏈設(shè)置規(guī)則
備注:
? 在業(yè)務(wù)比較繁忙時(shí),不要設(shè)置永久配置,先設(shè)置運(yùn)行時(shí)配置,不會(huì)中斷原有業(yè)務(wù),等到夜晚不繁忙的時(shí)候,再設(shè)置永久配置
被激活的區(qū)域(區(qū)域內(nèi)有網(wǎng)卡存在)名會(huì)被黑色加粗;先指定要修改的區(qū)域,然后去修改服務(wù)等子選項(xiàng),這些配置只對(duì)在該區(qū)域內(nèi)的網(wǎng)卡生效
[root@localhost ~]# rpm -q httpd
httpd-2.4.6-90.el7.centos.x86_64
[root@localhost ~]# firewall-config
C:\Users\GSY>ping 192.168.247.142
正在 Ping 192.168.247.142 具有 32 字節(jié)的數(shù)據(jù):
來(lái)自 192.168.247.142 的回復(fù): 字節(jié)=32 時(shí)間<1ms TTL=64
來(lái)自 192.168.247.142 的回復(fù): 字節(jié)=32 時(shí)間<1ms TTL=64
來(lái)自 192.168.247.142 的回復(fù): 字節(jié)=32 時(shí)間<1ms TTL=64
來(lái)自 192.168.247.142 的回復(fù): 字節(jié)=32 時(shí)間<1ms TTL=64
192.168.247.142 的 Ping 統(tǒng)計(jì)信息:
數(shù)據(jù)包: 已發(fā)送 = 4,已接收 = 4,丟失 = 0 (0% 丟失),
往返行程的估計(jì)時(shí)間(以毫秒為單位):
最短 = 0ms,最長(zhǎng) = 0ms,平均 = 0ms
關(guān)閉icmp的請(qǐng)求選項(xiàng)
C:\Users\GSY>ping 192.168.247.142
正在 Ping 192.168.247.142 具有 32 字節(jié)的數(shù)據(jù):
來(lái)自 192.168.247.142 的回復(fù): 無(wú)法訪(fǎng)問(wèn)目標(biāo)主機(jī)。
來(lái)自 192.168.247.142 的回復(fù): 無(wú)法訪(fǎng)問(wèn)目標(biāo)主機(jī)。
來(lái)自 192.168.247.142 的回復(fù): 無(wú)法訪(fǎng)問(wèn)目標(biāo)主機(jī)。
來(lái)自 192.168.247.142 的回復(fù): 無(wú)法訪(fǎng)問(wèn)目標(biāo)主機(jī)。
192.168.247.142 的 Ping 統(tǒng)計(jì)信息:
數(shù)據(jù)包: 已發(fā)送 = 4,已接收 = 4,丟失 = 0 (0% 丟失),
[root@localhost ~]# ssh root@192.168.247.142
The authenticity of host '192.168.247.142 (192.168.247.142)' can't be established.
ECDSA key fingerprint is SHA256:dXWxtS2ShXQgfb7R672V7+l3i7rGqHBbIB5MTcFnAws.
ECDSA key fingerprint is MD5:59:fb:20:f0:28:96:5e:14:90:82:63:c9:ae:67:d6:e9.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.247.142' (ECDSA) to the list of known hosts.
root@192.168.247.142's password:
Last login: Mon Dec 9 13:42:31 2019 from 192.168.247.1
[root@localhost ~]# exit
登出
Connection to 192.168.247.142 closed.
[root@localhost ~]# ssh root@192.168.247.142
ssh: connect to host 192.168.247.142 port 22: No route to host
[root@localhost ~]#
[root@localhost ~]# ifconfig
ens33: flags=4163 mtu 1500
inet 192.168.247.143 netmask 255.255.255.0 broadcast 192.168.247.255
inet6 fe80::e2c1:c26d:afa1:a4ad prefixlen 64 scopeid 0x20
ether 00:0c:29:52:4d:89 txqueuelen 1000 (Ethernet)
RX packets 602 bytes 49107 (47.9 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 227 bytes 24670 (24.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@localhost ~]# ssh root@192.168.247.142
root@192.168.247.142's password:
Last login: Mon Dec 9 14:05:12 2019 from 192.168.247.1
[root@localhost ~]#
[root@localhost ~]# systemctl start httpd
[root@localhost ~]# netstat -natp | grep 'httpd'
tcp6 0 0 :::80 :::* LISTEN 119597/httpd
[root@localhost ~]#
[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 一 2019-12-09 09:26:39 CST; 5h 14min ago
Docs: man:firewalld(1)
Main PID: 803 (firewalld)
CGroup: /system.slice/firewalld.service
└─803 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid
12月 09 14:10:14 localhost.localdomain firewalld[803]: WARNING: COMMAND_FAILED: '/usr/sb....
12月 09 14:10:14 localhost.localdomain firewalld[803]: WARNING: COMMAND_FAILED: '/usr/sb....
12月 09 14:10:14 localhost.localdomain firewalld[803]: WARNING: COMMAND_FAILED: '/usr/sb....
12月 09 14:10:14 localhost.localdomain firewalld[803]: WARNING: COMMAND_FAILED: '/usr/sb....
12月 09 14:10:14 localhost.localdomain firewalld[803]: WARNING: COMMAND_FAILED: '/usr/sb....
12月 09 14:10:14 localhost.localdomain firewalld[803]: WARNING: COMMAND_FAILED: '/usr/sb....
12月 09 14:10:14 localhost.localdomain firewalld[803]: WARNING: COMMAND_FAILED: '/usr/sb....
12月 09 14:10:14 localhost.localdomain firewalld[803]: WARNING: COMMAND_FAILED: '/usr/sb....
12月 09 14:10:14 localhost.localdomain firewalld[803]: WARNING: COMMAND_FAILED: '/usr/sb....
12月 09 14:10:14 localhost.localdomain firewalld[803]: WARNING: COMMAND_FAILED: '/usr/sb....
Hint: Some lines were ellipsized, use -l to show in full.
[root@localhost ~]# firewall-cmd --state
running
[root@localhost ~]#
[root@localhost ~]# firewall-cmd --reload
success
[root@localhost ~]#
[root@localhost ~]# firewall-cmd --complete-reload
success
[root@localhost ~]#
[root@localhost ~]# systemctl restart firewalld
[root@localhost ~]# firewall-cmd --get-zones
block dmz drop external home internal public trusted work
[root@localhost ~]#
[root@localhost ~]# firewall-cmd --get-services
RH-Satellite-6 amanda-client amanda-k5-client bacula bacula-client bitcoin bitcoin-rpc bitcoin-testnet bitcoin-testnet-rpc ceph ceph-mon cfengine condor-collector ctdb dhcp dhcpv6 dhcpv6-client DNS docker-registry dropbox-lansync elasticsearch freeipa-ldap freeipa-ldaps freeipa-replication freeipa-trust ftp ganglia-client ganglia-master high-availability http https imap imaps ipp ipp-client ipsec iscsi-target kadmin kerberos kibana klogin kpasswd kshell ldap ldaps libvirt libvirt-tls managesieve mdns mosh mountd ms-wbt mssql MySQL nfs nrpe ntp open*** ovirt-imageio ovirt-storageconsole ovirt-vmconsole pmcd pmproxy pmwebapi pmwebapis pop3 pop3s postgresql privoxy proxy-dhcp ptp pulseaudio puppetmaster quassel radius rpc-bind rsh rsyncd samba samba-client sane sip sips smtp smtp-submission smtps snmp snmptrap spideroak-lansync squid ssh synergy syslog syslog-tls telnet tftp tftp-client tinc tor-socks transmission-client vdsm vnc-server wbem-https xmpp-bosh xmpp-client xmpp-local xmpp-server
[root@localhost ~]#
[root@localhost ~]# firewall-cmd --get-icmptypes
address-unreachable bad-header communication-prohibited destination-unreachable echo-reply echo-request fragmentation-needed host-precedence-violation host-prohibited host-redirect host-unknown host-unreachable ip-header-bad neighbour-advertisement neighbour-solicitation network-prohibited network-redirect network-unknown network-unreachable no-route packet-too-big parameter-problem port-unreachable precedence-cutoff protocol-unreachable redirect required-option-missing router-advertisement router-solicitation source-quench source-route-failed time-exceeded timestamp-reply timestamp-request tos-host-redirect tos-host-unreachable tos-network-redirect tos-network-unreachable ttl-zero-during-reassembly ttl-zero-during-transit unknown-header-type unknown-option
[root@localhost ~]#
[root@localhost ~]# firewall-cmd --get-default-zone
public
[root@localhost ~]#
[root@localhost ~]# firewall-cmd --set-default-zone=internal
success
[root@localhost ~]#
[root@localhost ~]# firewall-cmd --get-active-zones
public
interfaces: ens33
[root@localhost ~]#
激活的條件 : 區(qū)域至少關(guān)聯(lián)一個(gè)接口或一個(gè)源地址/網(wǎng)段
[root@localhost ~]# firewall-cmd --get-zone-of-interface=ens33
public
[root@localhost ~]#
[root@localhost ~]# firewall-cmd --zone=work --add-interface=ens33
The interface is under control of NetworkManager, setting zone to 'work'.
success
[root@localhost ~]#
[root@localhost ~]# firewall-cmd --zone=work --change-interface=ens33
The interface is under control of NetworkManager and already bound to 'work'
The interface is under control of NetworkManager, setting zone to 'work'.
success
[root@localhost ~]#
[root@localhost ~]# firewall-cmd --zone=work --remove-interface=ens33
The interface is under control of NetworkManager, setting zone to default.
success
[root@localhost ~]#
[root@localhost ~]# firewall-cmd --zone=work --query-interface=ens33
no
[root@localhost ~]#
[root@localhost ~]# firewall-cmd --list-all-zones
block
target: %%REJECT%%
icmp-block-inversion: no
interfaces:
sources:
services:
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
dmz
target: default
icmp-block-inversion: no
interfaces:
sources:
services: ssh
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
drop
target: DROP
icmp-block-inversion: no
interfaces:
sources:
services:
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
external
target: default
icmp-block-inversion: no
interfaces:
sources:
services: ssh
ports:
protocols:
masquerade: yes
forward-ports:
source-ports:
icmp-blocks:
rich rules:
home
target: default
icmp-block-inversion: no
interfaces:
sources:
services: ssh mdns samba-client dhcpv6-client
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
internal (active)
target: default
icmp-block-inversion: no
interfaces: ens33
sources:
services: ssh mdns samba-client dhcpv6-client
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
public
target: default
icmp-block-inversion: no
interfaces:
sources:
services: ssh dhcpv6-client http
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
trusted
target: ACCEPT
icmp-block-inversion: no
interfaces:
sources:
services:
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
work
target: default
icmp-block-inversion: no
interfaces:
sources:
services: ssh dhcpv6-client
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
[root@localhost ~]#
[root@localhost ~]# firewall-cmd --zone=internal --list-all
internal (active)
target: default
icmp-block-inversion: no
interfaces: ens33
sources:
services: ssh mdns samba-client dhcpv6-client
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
[root@localhost ~]#
[root@localhost ~]# firewall-cmd --list-all
internal (active)
target: default
icmp-block-inversion: no
interfaces: ens33
sources:
services: ssh mdns samba-client dhcpv6-client
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
[root@localhost ~]#
[root@localhost ~]# firewall-cmd --zone=internal --list-services
ssh mdns samba-client dhcpv6-client
[root@localhost ~]# firewall-cmd --zone=public --add-service=smtp
success
[root@localhost ~]#
[root@localhost ~]# firewall-cmd --zone=internal --remove-service=ssh
success
[root@localhost ~]#
[root@localhost ~]# firewall-cmd --zone=internal --query-service=ssh
no
[root@localhost ~]#
[root@localhost ~]# firewall-cmd --zone=internal --list-ports
[root@localhost ~]# firewall-cmd --zone=internal --add-port=22/tcp --timeout=5m
success
[root@localhost ~]#
[root@localhost ~]# firewall-cmd --zone=internal --remove-port=22/tcp
success
[root@localhost ~]#
[root@localhost ~]# firewall-cmd --zone=internal --query-port=22/tcp
no
[root@localhost ~]#
[root@localhost ~]# firewall-cmd --zone=work --list-icmp-blocks
[root@localhost ~]#
[root@localhost ~]# firewall-cmd --zone=work --add-icmp-block=echo-request
success
[root@localhost ~]#
[root@localhost ~]# firewall-cmd --zone=work --list-icmp-blocks
echo-request
[root@localhost ~]# firewall-cmd --zone=work --add-icmp-block=echo-reply
success
[root@localhost ~]#
[root@localhost ~]# firewall-cmd --zone=work --remove-icmp-block=echo-reply
success
[root@localhost ~]# firewall-cmd --zone=work --list-icmp-blocks
echo-request
[root@localhost ~]#
[root@localhost ~]# firewall-cmd --zone=work --query-icmp-block=echo-request
yes
[root@localhost ~]#
備注: 阻塞,即不讓通行的意思