Show Table of Contents
4.11. 安全性和存取控制
請參閱此部分,以取得 Red Hat Enterprise Linux 6 和 Red Hat Enterprise Linux 7 之間,安全性、存取控制和相關配置工具上的變更概要。
4.11.1. 新的防火牆(firewalld)
在 Red Hat Enterprise Linux 6 中,防火牆功能乃透過 iptables 工具程式所提供,並且透過指令列或是圖形化配置工具 system-config-firewall 來進行配置。在 Red Hat Enterprise Linux 7 中,防火牆功能依然是透過 iptables 來提供的。然而,管理員現在將會透過
firewalld 這個動態式防火牆 daemon 及其配置工具 firewall-config、firewall-cmd 與 firewall-applet(這些工具不包含在 Red Hat Enterprise Linux 7 的預設安裝中)來與 iptables 進行互動。
因為
firewalld 乃動態式的系統程式,因此您能在任何時候對其配置進行變更,並且該變更將會即時生效。防火牆沒有需要重新載入的部分,因此不會無意間中斷既有的網路連線。
Red Hat Enterprise Linux 6 和 7 之間,防火牆上的主要差異為:
- 防火牆配置詳細資訊已不再存放在
/etc/sysconfig/iptables中,並且此檔案已不再存在。現在配置詳細資訊已存放在/usr/lib/firewalld和/etc/firewalld目錄中的各種檔案裡。 - Red Hat Enterprise Linux 6 中的防火牆系統會在每次配置經過變更時,移除並重新套用所有規則,
firewalld僅會套用配置上的差異。基於如此,firewalld能在 runtime 時更改設定,而不失去既有的連線。
欲取得更多有關於 Red Hat Enterprise Linux 7 中的防火牆配置上的相關資訊與協助,請參閱《Red Hat Enterprise Linux 7 安全性指南》,位於〈http://access.redhat.com/site/documentation/Red_Hat_Enterprise_Linux/〉。
4.11.1.1. 遷移規則至 firewalld
Red Hat Enterprise Linux 6 提供了兩種防火牆配置:
- 請使用圖形化工具 system-config-firewall 來配置規則。這項工具會將其配置詳細資訊存放在
/etc/sysconfig/system-config-firewall檔案中,並在/etc/sysconfig/iptables和/etc/sysconfig/ip6tables檔案中為iptables和ip6tables服務建立配置。 - 手動式編輯
/etc/sysconfig/iptables和/etc/sysconfig/ip6tables檔案(從頭開始或是編輯一份由 system-config-firewall 所產生的初始配置)。
若您以 system-config-firewall 配置您的 Red Hat Enterprise Linux 6 防火牆,在您更新之後,您可使用 firewall-offline-cmd 工具來將
/etc/sysconfig/system-config-firewall 中的配置遷移至 firewalld 的預設區域中。
$ firewall-offline-cmd
然而,若您手動建立或編輯了
/etc/sysconfig/iptables 或 /etc/sysconfig/ip6tables,您必須透過 firewall-cmd 或 firewall-config建立新的配置,或是停用 firewalld 並繼續使用舊的 iptables 和 ip6tables 服務。欲取得有關於建立新配置或是停用 firewalld 上的相關資訊,請參閱《Red Hat Enterprise Linux 7 安全性指南》,位於〈http://access.redhat.com/site/documentation/Red_Hat_Enterprise_Linux/〉。

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.