最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Centos7.x 系统关闭系统自带防火墙或调整设置iptables
时间:2022-06-30 17:43:51 编辑:袖梨 来源:一聚教程网
CentOS 7.x系统默认使用的是firewall做防火墙,而且有些端口没有开放,需要临时关闭或进行调整。如使用iptables需重新设置。
1、直接关闭防火墙
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
2、设置 iptables service
yum -y install iptables-services
如果要修改防火墙配置,可以直接编辑配置文件或使用命令进行添加即可。
比如编辑配置文件增加规则:
vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
保存退出。
systemctl restart iptables.service #重启生效
systemctl enable iptables.service #设置开机启动
相关文章
- 奥比岛梦想国度卡死闪退有哪些解决方法 04-30
- DNF手游骨戒在哪个位置 04-30
- 回望羊驼:当利空成为短暂的财富密码 04-30
- 为什么每个 Web3 项目都逃不过 DEX? 04-30
- HashKey Exchange 虚拟资产保险覆盖规模登顶全球第一 04-30
- HTX DeepThink:冲上$95,000后,等待比特币的是什么? 04-30