一 . firewall防火墙
1 检查防火墙状态
- 查看firewall服务状态:
systemctl status firewalld
- 查看firewall的状态:
firewall-cmd --state
2 开启、关闭防火墙
- 关闭:
systemctl stop firewalld.service
- 重启:
systemctl restart firewalld.service
- 开启:
systemctl start firewalld.service
- 关闭开机自启动:
systemctl disable firewalld.service
- 开启开机启动:
systemctl enable firewalld.service
3 开放某端口访问
- 检查开放了那些端口:
firewall-cmd --list-ports
- 开放某个端口:
firewall-cmd --zone=public --add-port=8848/tcp --permanent
- 重载防火墙配置:
firewall-cmd --reload