1. 程式人生 > >centos7防火牆埠設定

centos7防火牆埠設定

1.防火牆操作
啟動: systemctl start firewalld
檢視狀態: systemctl status firewalld 
停止: systemctl disable firewalld
禁用: systemctl stop firewalld
2.開放指定埠
firewall-cmd --zone=public --add-port=8000/tcp --permanent   //開放埠
firewall-cmd --reload                                                                   //重新載入,使其生效
3.關閉指定埠
firewall-cmd --zone=public --remove-port=8000/tcp --permanent            //關閉埠
firewall-cmd --reload                                                                   //重新載入,使其生效
4.檢視埠狀態
firewall-cmd --zone=public --query-port=8000/tcp                            //檢視埠狀態