安裝Firewall
yuminstallfirewalldfirewalld-config
開(kāi)啟常見(jiàn)端口
firewall-cmd–zone=public–add-port=80/tcp–permanent firewall-cmd–zone=public–add-port=443/tcp–permanent firewall-cmd–zone=public–add-port=22/tcp–permanent firewall-cmd–zone=public–add-port=21/tcp–permanent firewall-cmd–zone=public–add-port=53/udp–permanent
關(guān)閉常見(jiàn)端口
firewall-cmd–zone=public–remove-port=80/tcp–permanent firewall-cmd–zone=public–remove-port=443/tcp–permanent firewall-cmd–zone=public–remove-port=22/tcp–permanent firewall-cmd–zone=public–remove-port=21/tcp–permanent firewall-cmd–zone=public–remove-port=53/udp–permanent
批量添加區(qū)間端口
firewall-cmd–zone=public–add-port=4400-4600/udp–permanent firewall-cmd–zone=public–add-port=4400-4600/tcp–permanent
開(kāi)啟防火墻
systemctlstartfirewalld
重啟防火墻
firewall-cmd–reload
或者
servicefirewalldrestart
查看端口列表
firewall-cmd–permanent–list-port
禁用防火墻
systemctlstopfirewalld
設(shè)置開(kāi)機(jī)啟動(dòng)
systemctlenablefirewalld
停止并禁用開(kāi)機(jī)啟動(dòng)
sytemctldisablefirewalld
查看狀態(tài)
systemctlstatusfirewalld
或者
firewall-cmd–state
審核編輯:劉清
-
UDP協(xié)議
+關(guān)注
關(guān)注
0文章
68瀏覽量
12673 -
Firewall
+關(guān)注
關(guān)注
0文章
4瀏覽量
5480 -
TCP通信
+關(guān)注
關(guān)注
0文章
146瀏覽量
4200
原文標(biāo)題:防火墻常用命令有哪些?我?guī)湍阏砗昧耍?/p>
文章出處:【微信號(hào):網(wǎng)絡(luò)技術(shù)干貨圈,微信公眾號(hào):網(wǎng)絡(luò)技術(shù)干貨圈】歡迎添加關(guān)注!文章轉(zhuǎn)載請(qǐng)注明出處。
發(fā)布評(píng)論請(qǐng)先 登錄
相關(guān)推薦
評(píng)論