最新下载
热门教程
- 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-28
- 红色沙漠火焰双手锤获取方法 04-28
- 崩坏星穹铁道丹恒腾荒何时上线 04-28
- 《The Sheep Detectives》评测 04-28
- 27年发售悬了 《刺客信条 女巫》被曝50人集体调离 04-28
- 异环别有洞天越狱方式详解-别有洞天如何逃离监狱 04-28