主机操作系统:ubuntu 7.10
数据库系统:oracle 10g xe
虚拟机:virtualbox 1.5.2(安装windows xp操作系统)
问题描述:
为了使virtualbox中的windows能够上网,设置iptables的NAT转发功能:
代码: 全选
sudo iptables -t nat -A POSTROUTING -j MASQUERADE
将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
请问高手,应当如何设置iptables使得即可以开启NAT,又能够访问oracle数据库主页?
不胜感激!