|
|
平常我们使用的更多的是iptables服务,系统存在firewalld服务时,iptables的功能就被限制了,或者我们设置的防火墙规则都失效了。为了让iptables服务生效,我们需要删除系统的firewalld服务。
1 w! W% ~' F# A" P( ]# v4 k8 Nrpm -qa |grep firewalld###stop firewalld
- w2 L# [) k3 Ksystemctl stop firewalld.service; Q M9 K; q3 L& L( c( Z
####disable firewalld 1 G7 K- C/ i# M* G& P
systemctl disable firewalld.service) h' _3 z# X' U% B3 ^& @
#####remove firewalld
, @* H+ V* s Wnum2=`rpm -qa |grep firewalld`
2 W) i* ?( U1 ]8 ?( R, d1 T. K: ]7 Z1 W- q
if [ ! -n $num2 ]: [# J( u) I R- F' n% e2 Z
then; Y" s0 E) g* A6 b; n. S" M" c0 ?
rpm -e $num2 4 I8 Y4 P0 c# `- t. ^
else
m/ S+ `! A$ ] echo "firewall deleted"8 G" X" D* w9 g7 t) U, x" s
fi
4 _" U% `9 a8 d! n# K. r- B. A
`7 d! ]# O- e* w4 }; C- j$ e) z4 u' s$ |4 t
|
|