將firewall-cmd指令轉換為iptables指令

將firewall-cmd指令轉換為iptables指令

我讀這裡iptables軟體包是 Linux 核心的一部分,並且每個 GUI 防火牆工具最終都會翻譯成某種iptable規則。

現在我正在設定 Centos 8 伺服器如下使用以下行設定防火牆設定的指南:

sudo firewall-cmd --zone=public --permanent --add-service=http
sudo firewall-cmd --reload

在此之前,我無法在瀏覽器中/var/www/html/index.html使用我的索引頁面。http://xxx.xxx.xxx.xxx/index.html但此後我可以訪問該網站。

令我驚訝的是,桌子內的三個鍊子上都沒有附加任何東西iptables。換句話說,表完全是空的:

[ziga@localhost ~]$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination  

[ziga@localhost ~]$ sudo iptables -S
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT

看起來firewall-cmd正在做一些我不理解的事情,我想避免這種情況。有沒有一種方法可以達到firewall-cmd與僅使用指令完全相同的結果iptable

相關內容