LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 643|回复: 0

RH9.0下IPTABLES做NAT时DNS无法解析??

[复制链接]
发表于 2006-6-12 18:25:59 | 显示全部楼层 |阅读模式
最近给1客户做维护,遇到RH9,做NAT按理说不是很难,但在是实际调试中遇到如下问题,请有经验的爱好者帮忙看看,我还缺少了哪些东西。

疑难问题:在客户端能PING通外网的一切IP地址,但PING不同外网的域名,能TRECERT外网的IP地址,所有网段的客户端无法上网。内部有6个子网,通过三层交换到RH9.0.


# ifconfig eth0 218.22.25.X netmask 255.255.255.240 up
# ifconfig eth1 192.168.1.1 netmask 255.255.255.0 up
# echo 1 > /proc/sys/net/ipv4/ip_forward
# route add default gw 218.22.25.X dev eth0
# route add 192.168.2.0 netmask 255.255.255.0 192.168.1.254  metric 2
# route add 192.168.3.0 netmask 255.255.255.0 192.168.1.254  metric 2
# route add 192.168.4.0 netmask 255.255.255.0 192.168.1.254  metric 2
# route add 192.168.5.0 netmask 255.255.255.0 192.168.1.254  metric 2
# route add 192.168.6.0 netmask 255.255.255.0 192.168.1.254  metric 2
# iptables -t nat -F
# iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eth0 -j SNAT --to 218.22.25.X
# iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -o eth0 -j SNAT --to 218.22.25.X
# iptables -t nat -A POSTROUTING -s 192.168.3.0/24 -o eth0 -j SNAT --to 218.22.25.X
# iptables -t nat -A POSTROUTING -s 192.168.4.0/24 -o eth0 -j SNAT --to 218.22.25.X
# iptables -t nat -A POSTROUTING -s 192.168.5.0/24 -o eth0 -j SNAT --to 218.22.25.X
# iptables -t nat -A POSTROUTING -s 192.168.6.0/24 -o eth0 -j SNAT --to 218.22.25.X
# iptables -t nat -A PREROUTING -i eth0 -p tcp -d 218.22.25.X --dport 80 -j DNAT --to 192.168.1.2:80
# iptables -A OUTPUT -o eth0 -p udp -s 218.22.25.X --sport 1024:65535 -d any/0 --dport 53 -j ACCEPT
# iptables -A INTPUT -i eth0 -p udp -s any/0 --sport 53 -d 218.22.25.X --dport 1024:65535 -j ACCEPT
# service iptables save
在/etc/resolv.conf加入 nameserver 202.102.192.68
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表