linux 打开防火墙和关闭防火墙

本文介绍了在CentOS 7中如何使用firewalld替代iptables进行防火墙的开关、状态检查、开机启动/禁用操作,并对比了两个版本的区别。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

      linux系统防火墙的打开和关闭centos7和之前的版本的略有差别,centos7之前的版本可以通过iptables相关命令实现防火墙的打开和关闭;centos7使用firewall命令来开启和关闭防火墙。

centos7之前版本centos7
查看防火墙状态service iptables statussystemctl status firewalld.service
开启防火墙service iptables startsystemctl start firewalld.service
关闭防火墙service iptables stopsystemctl stop firewalld.service
重启防火墙service iptables restartsystemctl restart firewalld.service
永久关闭防火墙chkconfig iptables off 
永久打开防火墙chkconfig iptables on
开机启动防火墙systemctl enable firewalld.service
开机禁用防火墙systemctl disable firewalld.service
查看防火墙是否开机systemctl  is-enabled firewalld.service


 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值