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
相关推荐
搬码临时工2 小时前
电脑同时连接内网和外网的方法,附外网连接局域网的操作设置
运维·服务器·网络
Gaoithe2 小时前
ubuntu 端口复用
linux·运维·ubuntu
德先生&赛先生3 小时前
Linux编程:1、文件编程
linux
程序猿小D3 小时前
第16节 Node.js 文件系统
linux·服务器·前端·node.js·编辑器·vim
多多*4 小时前
微服务网关SpringCloudGateway+SaToken鉴权
linux·开发语言·redis·python·sql·log4j·bootstrap
南林yan6 小时前
DLL动态库实现文件遍历功能(Windows编程)
windows
Mike_6666 小时前
win10安装WSL2、Ubuntu24.04
windows·ubuntu·wsl2
IT界小黑的对象6 小时前
virtualBox部署ubuntu22.04虚拟机 NAT+host only 宿主机ping不通虚拟机
linux·运维·服务器
SilentCodeY6 小时前
Ubuntu 系统通过防火墙管控 Docker 容器
linux·安全·ubuntu·系统防火墙
weixin_527550406 小时前
Linux 环境下高效视频切帧的实用指南
linux·运维·音视频