当前位置:主页 > 查看内容

CentOS 7 防火墙的系列操作

发布时间:2021-08-16 00:00| 位朋友查看

简介:?1、开启防火墙 firewall systemctl start firewalld 2、查看防火墙 firewall 状态 firewall-cmd --state 3、?停止防火墙 firewall systemctl stop firewalld.service ?4、重启防火墙 firewall firewall-cmd --reload ?5、开放指定端口 firewall-cmd --zone……
?1、开启防火墙 firewall
systemctl start firewalld

image.gif

2、查看防火墙 firewall 状态
firewall-cmd --state

image.gif

3、?停止防火墙 firewall
systemctl stop firewalld.service

image.gif

?4、重启防火墙 firewall
firewall-cmd --reload

image.gif

?5、开放指定端口
firewall-cmd --zone public --add-port 3306/tcp --permanent

image.gif

?命令含义

--zone #作用域

--add-port 3306/tcp #添加端口 格式为 端口/通讯协议

--permanent #永久生效 没有此参数重启后失效

?6、查看端口号
netstat -ntlp //查看当前所有tcp端口·
netstat -ntulp |grep 3306 //查看所有3306端口使用情况·

image.gif

?7、禁止firewall开机启动
systemctl disable firewalld.service

image.gif



本文转自网络,原文链接:https://developer.aliyun.com/article/787044
本站部分内容转载于网络,版权归原作者所有,转载之目的在于传播更多优秀技术内容,如有侵权请联系QQ/微信:153890879删除,谢谢!
上一篇:阿里开源的分布式事务框架 Seata部署 下一篇:没有了

推荐图文


随机推荐