查看防火墻狀態
?or?
root@localhost ~]#? systemctl status firewalld? /??firewall-cmd --state
啟動防火墻
[root@localhost ~]# systemctl start firewalld
關閉防火墻
[root@localhost ~]# systemctl stop firewalld
設置開機啟動
[root@localhost ~]# systemctl enable firewalld
停止并禁用開機啟動
[root@localhost ~]#?sytemctl disable firewalld
?
端口設置:
Linux 防火墻開放端口命令:
firewall-cmd --zone=public --permanent --add-port=port(要添加的端口號)/tcp? ? (permanent參數是為了設置為永久生效)
重啟防火墻
[root@localhost ~]# firewall-cmd --reload
查看防火墻開放的所有端口列表
[root@localhost ~]# firewall-cmd --zone=public --list-ports