導航:首頁 > 程序命令 > 防火牆打開命令

防火牆打開命令

發布時間:2023-08-12 06:16:50

❶ redhat6 如何啟動防火牆

使用Iptables與Firewalld防火牆《Linux就該這么學》有圖形化和命令行2 種
介紹命令行
chkconfig iptables off(設置自動啟動為關閉)
chkconfig iptables on(設置自動啟動為啟動)
chkconfig --del iptables(移除開啟自啟動)
chkconfig --add iptables(增加開啟自啟動)
在早期的Linux系統中,默認使用的是iptables防火牆管理服務來配置防火牆。從RHEL 7系統開始,firewalld防火牆正式取代了iptables防火牆。所以你只需要使用iptables就行了。
iptables是一款基於命令行的防火牆策略管理工具,具有大量參數,學習難度較大。好在對於日常的防火牆策略配置來講,大家無需深入了解諸如「四表五鏈」的理論概念,只需要掌握常用的參數並做到靈活搭配即可,這就足以應對日常工作了。
使用iptables命令配置的防火牆規則默認會在系統下一次重啟時失效,如果想讓配置的防火牆策略永久生效,還要執行保存命令:# iptables-save

❷ 安點科技防火牆命令

1、firewalld的基本使用
啟動: systemctl start firewalld
查看狀態: systemctl status firewalld
禁用,禁止開機啟動: systemctl disable firewalld
停止運行: systemctl stop firewalld

2.配置firewalld-cmd
查看版本: firewall-cmd --version
查看幫助: firewall-cmd --help
顯示狀態: firewall-cmd --state
查看所有打開的埠: firewall-cmd --zone=public --list-ports
更新防火牆規則: firewall-cmd --reload
更新防火牆規則,重啟服務: firewall-cmd --completely-reload
查看已激活的Zone信息: firewall-cmd --get-active-zones
查看指定介面所屬區域: firewall-cmd --get-zone-of-interface=eth0
拒絕所有包:firewall-cmd --panic-on
取消拒絕狀態: firewall-cmd --panic-off
查看是否拒絕: firewall-cmd --query-panic

3.信任級別,通過Zone的值指定
drop: 丟棄所有進入的包,而不給出任何響應
block: 拒絕所有外部發起的連接,允許內部發起的連接
public: 允許指定的進入連接
external: 同上,對偽裝的進入連接,一般用於路由轉發
dmz: 允許受限制的進入連接
work: 允許受信任的計算機被限制的進入連接,類似 workgroup
home: 同上,類似 homegroup
internal: 同上,范圍針對所有互聯網用戶
trusted: 信任所有連接

4.firewall開啟和關閉埠
以下都是指在public的zone下的操作,不同的Zone只要改變Zone後面的值就可以
添加:
firewall-cmd --zone=public --add-port=80/tcp --permanent (--permanent永久生效,沒有此參數重態斗晌啟後失效)
重新載入:銷埋
firewall-cmd --reload
查看:
firewall-cmd --zone=public --query-port=80/tcp
刪除:
firewall-cmd --zone=public --remove-port=80/tcp --permanent

5.管理服務
以smtp服務為例, 添加到work zone
添加:
firewall-cmd --zone=work --add-service=smtp
查看:
firewall-cmd --zone=work --query-service=smtp
刪除:
firewall-cmd --zone=work --remove-service=smtp

5.配置 IP 地址偽裝
查看:
firewall-cmd --zone=external --query-masquerade
打開:
firewall-cmd --zone=external --add-masquerade
關閉:
firewall-cmd --zone=external --remove-masquerade

6.埠轉發
打開埠轉發,首先需要打開IP地址偽裝
firewall-cmd --zone=external --add-masquerade

轉發 tcp 22 埠至 3753:
firewall-cmd --zone=external --add-forward-port=22:porto=tcp:toport=3753
轉發埠數據至另一個IP的相同埠:
firewall-cmd --zone=external --add-forward-port=22:porto=tcp:toaddr=192.168.1.112
轉發埠數據至帆鋒另一個IP的 3753 埠:
firewall-cmd --zone=external --add-forward-port=22:porto=tcp::toport=3753:toaddr=192.168.1.112

6.systemctl是CentOS7的服務管理工具中主要的工具,它融合之前service和chkconfig的功能於一體。
啟動一個服務:systemctl start firewalld.service
關閉一個服務:systemctl stop firewalld.service
重啟一個服務:systemctl restart firewalld.service
顯示一個服務的狀態:systemctl status firewalld.service
在開機時啟用一個服務:systemctl enable firewalld.service
在開機時禁用一個服務:systemctl disable firewalld.service
查看服務是否開機啟動:systemctl is-enabled firewalld.service
查看已啟動的服務列表:systemctl list-unit-files|grep enabled
查看啟動失敗的服務列表:systemctl --failed

閱讀全文

與防火牆打開命令相關的資料

熱點內容
汽車小壓縮機拆解 瀏覽:825
雲桌面卡是因為伺服器的原因嗎 瀏覽:377
qd123壓縮機 瀏覽:969
pn532讀取加密門禁卡 瀏覽:85
win10文件夾屬性里無法加密 瀏覽:34
比特幣加密的條件 瀏覽:848
求購現成影視app源碼 瀏覽:572
wdsecurity加密版 瀏覽:813
雲伺服器和雲豐雲 瀏覽:188
伺服器如何設置獨立ip 瀏覽:857
tar命令打包文件夾 瀏覽:1000
刪除linux用戶和組 瀏覽:548
小米的程序員都用什麼筆記本 瀏覽:703
位元組三面演算法題 瀏覽:971
伺服器保護有什麼好處 瀏覽:894
全部下載完後進行統一解壓 瀏覽:393
遠嫁的程序員媽媽 瀏覽:555
1024程序員節安全攻防挑戰賽 瀏覽:786
怎麼解除txt加密 瀏覽:772
javahttp流 瀏覽:656