Centos服务器相关
Centos中开启关闭防火墙
2022-08-12 305 0
简介
1.设置开机启用防火墙:systemctl enable firewalld.service
2.设置开机禁用防火墙:systemctl disable firewalld.service
3.启动防火墙:systemctl start firewalld
4.关闭防火墙:systemctl stop firewalld
systemctl status firewalld
要记得开启防火墙,默认是关闭的
查看已打开的端口
firewall-cmd --list-ports
查看防火墙规则
firewall-cmd --list-all
# 查询端口是否开放firewall-cmd --query-port=8080/tcp#
开放80端口firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --permanent --add-port=443/tcp
firewall-cmd --permanent --add-port=8098/tcp
firewall-cmd --permanent --add-port=8080/tcp
移除端口firewall-cmd --permanent --remove-port=8080/tcp
#重启防火墙(修改配置后要重启防火墙)firewall-cmd --reload
# 参数解释
1、firwall-cmd:是Linux提供的操作firewall的一个工具;
2、--permanent:表示设置为持久;
3、--add-port:标识添加的端口;
最近更新
- Android 使用 ExecutorService和Future搭配使用
- 不同颜色的USB接口都有什么含义?
- 【Android Studio】强制使用低版本系统出现Google Play requires that apps target API level 29 or higher.
- IndentationError: unindent does not match any outer indentation level 报错
- 报错 OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized
- Python字符串完全指南:从零开始,轻松掌握

