CentOS7在防火墙与端口上的操作

2024-10-12 19:04:46

1、CentOS7使用systemctl指令来管理系统的单一服务,在CentOS7中对于firewalld(防火墙)服务的开启、关闭、状态查询也同样是使用该指令,操作如下:

2、启动防火墙: systemctl start firewalld

3、查看防火墙状态: systemctl status firewalld

CentOS7在防火墙与端口上的操作

5、开机时启用防火墙服务:systemctl enable firewalld开机时禁用防火墙服务:systemctl disable firewalld

CentOS7在防火墙与端口上的操作

6、查询防火墙服务是否开机启动:systemctl is-enabled firewalld

CentOS7在防火墙与端口上的操作

8、查询启动失败的服务列表:systemctl --failed

CentOS7在防火墙与端口上的操作

10、更新防火墙规则:firewall-cmd--reload查看端口状态:firewall-cmd--zone=public--query-port=80/tcp

CentOS7在防火墙与端口上的操作

12、每次都更新防火墙规则,都需要重新更新:firewall-cmd--reload,更新状态;

13、此外,在更新完防火墙的设置后,也可以查看所有开启的端口:firewall-cmd --zone=public --list-ports

CentOS7在防火墙与端口上的操作
猜你喜欢