查看防火牆的狀態的命令為:
sudo systemctl status firewalld
打開防火牆的方式有兩種,一種是打開后重啟會恢復回原來的狀態,命令為:
sudo systemctl start firewalld
另一種是打開后重啟不會恢復到原來的狀態,命令為:
sudo systemctl enable firewalld
這種方式輸入命令后要重啟系統才會生效。
關閉防火牆的方式也有兩種,和打開相對應,命令分別為
sudo systemctl stop firewalld sudo systemctl disable firewalld