共計 3315 個字符,預計需要花費 9 分鐘才能閱讀完成。
這篇文章給大家介紹如何解析 RHEL 5 防火墻的設置,內容非常詳細,感興趣的小伙伴們可以參考借鑒,希望對大家能有所幫助。
眾所周知防火墻是計算機的安全性的重要保障,所以在 RHEL 5 防火墻的設置中也很很要,也正是因為它很重要所以在這里要對這個重要而又繁瑣的 RHEL 5 防火墻設置進行一下詳細的描述。
在 RHEL5.2 上安裝好了 Oracle,可以開始進行 Oracle 練習了。由于我的 RHEL 是安裝在虛擬機上的,總在虛擬機里操作終歸不是那么方便并且響應速度也較慢。好在 Oracle 10g 里已經有了 B / S 的管理界面,那么在 VM 的 Host 上操作豈不是簡單、快捷!虛擬機 (VM)IP:10.10.10.197,虛擬機主機(HOST)IP:10.10.10.198,橋接方式(Bridged)連接。可當我在瀏覽器地址欄輸入地址 http://10.10.10.197:1158/em 時,卻提示“Firefox 無法建立到 10.10.10.197:1158 服務器的連接”。可在 VM 中卻執行得很強大,在 10.10.10.198 上 Ping 10.10.10.197 也沒問題。開始尋找解決辦法。從【System- Administration- Security Level and Firewall】進入。RHEL 5 防火墻是 Enabled 狀態。可 Trusted Services 里卻明明有 WWW(HTTP) 服務,為何還是不行呢?
(安全及防火墻菜單)
(防火墻狀態及設置)
再從【System- Administration- Server Settings- Services】查看服務,找到一個名為 iptables 的服務,原來它就是防火墻服務。
(防火墻服務)
有停止,和在 Windows 下的 Services 一樣,那么 Stop 掉。在 10.10.10.198 上刷新 http://10.10.10.197:1158/em。一切盡在預料之中,界面出來了!看來還是防火墻配置的問題。在網絡上搜索了一下,可以進行如下配置(參考:http://linux.ccidnet.com/art/9513/20070601/1098119_1.html):
1. 查看 RHEL 5 防火墻現有配置
[root@RHEL ~]# iptables -L -n
Chain INPUT (policy ACCEPT)
target prot opt source destination
RH-Firewall-1-INPUT all — 0.0.0.0/00.0.0.0/0
ACCEPT tcp — 0.0.0.0/00.0.0.0/0 tcp dpt:1158
Chain FORWARD (policy ACCEPT)
target prot opt source destination
RH-Firewall-1-INPUT all — 0.0.0.0/00.0.0.0/0
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain RH-Firewall-1-INPUT (2 references)
target prot opt source destination
ACCEPT all — 0.0.0.0/00.0.0.0/0
ACCEPT icmp — 0.0.0.0/00.0.0.0/0 icmp type 255
ACCEPT esp — 0.0.0.0/00.0.0.0/0
ACCEPT ah — 0.0.0.0/00.0.0.0/0
ACCEPT udp — 0.0.0.0/0224.0.0.251 udp dpt:5353
ACCEPT udp — 0.0.0.0/00.0.0.0/0 udp dpt:631
ACCEPT tcp — 0.0.0.0/00.0.0.0/0 tcp dpt:631
ACCEPT all — 0.0.0.0/00.0.0.0/0 state RELATED,ESTABLISHED
ACCEPT tcp — 0.0.0.0/00.0.0.0/0 state NEW tcp dpt:21
ACCEPT tcp — 0.0.0.0/00.0.0.0/0 state NEW tcp dpt:22
ACCEPT tcp — 0.0.0.0/00.0.0.0/0 state NEW tcp dpt:443
ACCEPT tcp — 0.0.0.0/00.0.0.0/0 state NEW tcp dpt:23
ACCEPT tcp — 0.0.0.0/00.0.0.0/0 state NEW tcp dpt:80
REJECT all — 0.0.0.0/00.0.0.0/0 reject-with icmp-host-prohibited
2. 清除 RHEL 5 防火墻配置
[root@RHEL ~]# iptables -F
[root@RHEL ~]# iptables -X
[root@RHEL ~]# /etc/rc.d/init.d/iptables save
Saving firewall rules to /etc/sysconfig/iptables: [ OK ]
[root@RHEL ~]# iptables -L -n
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
3. 添加 RHEL 5 防火墻配置
將特定的端口添加到允許列表。比如 EM 使用的 1158、telnet 使用的 23 和 Litener 使用的 1521 等。
[root@RHEL ~]# iptables -A INPUT -p tcp –dport 1158 -j ACCEPT
[root@RHEL ~]# iptables -A INPUT -p tcp –dport 23 -j ACCEPT
[root@RHEL ~]# iptables -A INPUT -p tcp –dport 1521 -j ACCEPT
保存配置:
[root@RHEL ~]# /etc/rc.d/init.d/iptables save
Saving firewall rules to /etc/sysconfig/iptables: [ OK ]
查看一下當前配置:
[root@RHEL ~]# iptables -L -n
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp — 0.0.0.0/00.0.0.0/0 tcp dpt:1158
ACCEPT tcp — 0.0.0.0/00.0.0.0/0 tcp dpt:23
ACCEPT tcp — 0.0.0.0/00.0.0.0/0 tcp dpt:1521
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
重啟一下防火墻服務:
[root@RHEL ~]# service iptables restart
Flushing firewall rules: [ OK ]
Setting chains to policy ACCEPT: nat filter[ OK ]
Unloading iptables modules:[ OK ]
Applying iptables firewall rules: [ OK ]
Loading additional iptables modules: ip_conntrack_netbios_n[ OK ]ntrack_ftp
經過如此配置,在 10.10.10.198 上訪問 EM 正常,使用 PL/SQL Developer 等也能正常連接。
關于如何解析 RHEL 5 防火墻的設置就分享到這里了,希望以上內容可以對大家有一定的幫助,可以學到更多知識。如果覺得文章不錯,可以把它分享出去讓更多的人看到。