Serenade

操作防火墙,添加或删除端口,需要root权限。

1. 查看防火墙状态:systemctl status firewalld

active(running):开启状态,正在运行中

inactive(dead):关闭状态,未在运行

2. 开启防火墙:systemctl start firewalld,没有任何提示,表示开启成功

3. 关闭防火墙:systemctl stop firewalld

4. 添加mysql服务到防火墙,并加载

firewall-cmd --permanent --zone=public --add-service=mysql

firewall-cmd --reload

5. 打开防火墙的udp 8089端口

firewall-cmd --zone=public --add-port=8089/udp --permanent

#添加端口(--permanent表示永久生效,没有此参数重启后失效)

firewall-cmd --reload   这个命令必须运行,才能加载成功

6. 查看udp 8089端口是否添加成功,查询端口开启情况

firewall-cmd --zone=public --query-port=8089/udp

7. 删除防火墙8086端口

firewall-cmd --zone=public --remove-port=8086/tcp --permanent

firewall-cmd --reload

 

 

 

 

 

分类:

技术点:

相关文章:

  • 2021-08-27
  • 2022-01-09
  • 2022-01-30
  • 2021-12-10
  • 2021-07-18
  • 2022-12-23
猜你喜欢
  • 2021-07-25
  • 2022-12-23
  • 2021-11-13
  • 2021-09-17
  • 2021-12-04
  • 2022-12-23
  • 2021-11-30
相关资源
相似解决方案