要查看CentOS 7上的防火墙状态,可以执行以下命令:
1. 查看防火墙状态:
```shell
sudo systemctl status firewalld
```
2. 启动防火墙:
```shell
sudo systemctl start firewalld
```
3. 停止防火墙:
```shell
sudo systemctl stop firewalld
```
4. 重启防火墙:
```shell
sudo systemctl restart firewalld
```
5. 设置防火墙开机自启:
```shell
sudo systemctl enable firewalld
```
6. 禁止防火墙开机自启:
```shell
sudo systemctl disable firewalld
```
请注意,上述命令需要以root或具有sudo权限的用户身份执行。