操作"/>
Linux系统操作
Linux系统操作
- 1 防火墙操作
- 1.1 检查防火墙状态
- 1.2 防火墙配置
- 1.3 手动开关防火墙
- 1.3 开放防火墙端口
1 防火墙操作
1.1 检查防火墙状态
firewall-cmd --state
1.2 防火墙配置
- linux系统以后开机不需要启动防火墙
systemctl disable firewalld.service
- linux系统以后开机需要启动防火墙
systemctl enable firewalld.service
1.3 手动开关防火墙
- 关防火墙
systemctl stop firewalld.service
- 开防火墙
systemctl start firewalld.service
1.3 开放防火墙端口
- 检查防火墙开放的端口
firewall-cmd --list-ports
- 检查端口是否开放
firewall-cmd --query-port 80/tcp
- 开放防火墙端口
firewall-cmd --zone=public --add-port=80/tcp --permanent
- 移除端口
firewall-cmd --zone=public --remove-port=9090/tcp --permanent
- 重启防火墙
firewall-cmd --reload
关于防火墙操作的解释
- zone #作用域
- add-port=80/tcp #添加端口,格式为:端口/通讯协议
- remove-port=80/tcp #移除端口,格式为:端口/通讯协议
- permanent #永久生效,没有此参数重启后失效
更多推荐
Linux系统操作
发布评论