[问题]如何设置iptables使其不会屏蔽oracle 10g xe的访问?

Web、Mail、Ftp、DNS、Proxy、VPN、Samba、LDAP 等基础网络服务
回复
enloyee
帖子: 9
注册时间: 2007-06-20 12:11

[问题]如何设置iptables使其不会屏蔽oracle 10g xe的访问?

#1

帖子 enloyee » 2007-11-01 13:56

机器软件配置如下:
主机操作系统:ubuntu 7.10
数据库系统:oracle 10g xe
虚拟机:virtualbox 1.5.2(安装windows xp操作系统)

问题描述:
为了使virtualbox中的windows能够上网,设置iptables的NAT转发功能:

代码: 全选

sudo iptables -t nat -A POSTROUTING -j MASQUERADE
但是如此设置之后,使用firefox通过http://127.0.0.1:8080/apex访问oracle数据库主页时,firefox将apex识别为BIN类型文件,提示需要下载。
将iptables规则清空,脚本如下:

代码: 全选

#!/bin/bash

IPTABLES="/sbin/iptables"

$IPTABLES -P OUTPUT  ACCEPT
$IPTABLES -P INPUT   ACCEPT
$IPTABLES -P FORWARD ACCEPT
ip6tables -L -n > /dev/null 2>&1 && {
  ip6tables -P OUTPUT  ACCEPT
  ip6tables -P INPUT   ACCEPT
  ip6tables -P FORWARD ACCEPT
}

cat /proc/net/ip_tables_names | while read table; do
  test "X$table" = "Xmangle" && continue
  $IPTABLES -t $table -L -n | while read c chain rest; do
      if test "X$c" = "XChain" ; then
        $IPTABLES -t $table -F $chain
      fi
  done
  $IPTABLES -t $table -X
done
便可以访问http://127.0.0.1:8080/apex,但无法使用NAT功能。
请问高手,应当如何设置iptables使得即可以开启NAT,又能够访问oracle数据库主页?

不胜感激!
回复