详细解析RHEL 5防火墙的设置

系统 Linux
防火墙是计算机安全的重要保障措施之一,所以对于RHEL 5防火墙的设置也就很重要了,本文进行了详细的RHEL 5防火墙设置介绍,希望可以帮到大家对于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)服务,为何还是不行呢?

[[6250]]

(安全及防火墙菜单)

[[6251]]

(防火墙状态及设置)

 再从【System->Administration->Server Settings->Services】查看服务,找到一个名为iptables的服务,原来它就是防火墙服务。

[[6252]]

(防火墙服务)

有停止,和在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防火墙设置的,以上就是笔者对于RHEL 5防火墙设置的总结,希望可以帮助到大家对于RHEL 5防火墙的使用。

 

【编辑推荐】

  1. 设置ORACLE11g随RHELRHEL 5下Samba服务器的搭建
  2. RHELRHEL搭建FTP服务器步骤和问题解析(1)
  3. RHELRHEL 5搭建FTP的***组合
  4. 问题解析:这样使用RHELRHEL 4上配置Postfix的***4步
  5. RHEL架设RHEL4系统Sendmail的七大步骤
责任编辑:赵杰 来源: 博文
相关推荐

2011-07-01 11:56:56

2011-08-12 16:06:01

2011-03-09 11:23:26

2010-03-08 09:09:48

2010-09-14 17:20:30

2010-08-20 11:08:46

2009-02-21 10:28:43

2010-07-07 20:06:53

2010-03-19 16:13:43

2010-09-16 10:52:44

防火墙负载分担

2009-12-02 18:54:28

2010-03-31 17:43:44

CentOS防火墙

2009-12-08 17:37:49

Windows 7防火

2010-09-14 13:08:52

2010-09-17 10:07:28

2010-09-09 14:25:32

2010-09-14 14:18:45

2011-03-15 17:25:38

2010-12-21 18:04:26

2010-12-08 09:29:27

下一代防火墙
点赞
收藏

51CTO技术栈公众号