找回密码
 注册
查看: 4323|回复: 0

centos7下firewalld防火墙

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2018-5-8 10:52:10 | 显示全部楼层 |阅读模式
平常我们使用的更多的是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
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 01:58 , Processed in 0.013174 second(s), 23 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表