Linux开放防火墙端口

1、防火墙开放3306端口

powershell 复制代码
firewall-cmd --zone=public --add-port=3306/tcp --permanent

2、关闭防火墙

powershell 复制代码
service iptables stop

3、开启防火墙

powershell 复制代码
service iptables start

4、开机不自启防火墙

powershell 复制代码
chkconfig --del iptables

5、重启防火墙

powershell 复制代码
chkconfig iptables on

或者

powershell 复制代码
firewall-cmd --reload

重新关闭

powershell 复制代码
chkconfig iptables off

6、查看防火墙状态

powershell 复制代码
ervice iptables status  

7、查看已开启的端口

powershell 复制代码
firewall-cmd --list-ports
相关推荐
uiop_uiop_uiop3 小时前
fnOS LUKS on RAID Storage Pool
服务器
vortex54 小时前
PowerShell 的命令补全方案: PSReadLine + PSCompletions + argc + Carapace
windows·powershell
IT大白鼠4 小时前
Linux进程与计划任务管理:技术详解与实战指南
linux·运维·服务器
拾贰_C4 小时前
【Ubuntu | 公共工作站 | mysql 】 MySQL残留物残留数据
linux·mysql·ubuntu
Ujimatsu4 小时前
虚拟机安装Ubuntu 26.04.x服务器版(命令行版)(2026.5)
linux·windows·ubuntu
hweiyu005 小时前
Linux命令:arptables
linux·运维
仙柒4156 小时前
管理网络安全
linux·运维·服务器
isyangli_blog6 小时前
静态网站部署方案
服务器
福尔摩斯·柯南7 小时前
Ubuntu 14.04/16.04/18.04/20.04/22.04/24.04/26.04全系列LTS长期支持版镜像IOS分享
linux·运维·ubuntu