LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
12
返回列表 发新帖
楼主: cactus

服务器的问题,帮我解决一下好吗?

[复制链接]
 楼主| 发表于 2004-9-27 11:21:33 | 显示全部楼层
以下是我的rc.local脚本,

外网IP 61.161.72.211   eth1
内网IP 192.168.0.68    eth0


[root@Atmnet rc.d]# cat rc.local
#!/bin/bash
touch /var/lock/subsys/local
echo "Starting iptables nat rules ..."

service iptables stop

/sbin/modprobe ip_tables
/sbin/modprobe ip_nat_ftp
/sbin/modprobe ip_conntrack_ftp

echo 1 > /proc/sys/net/ipv4/ip_forward
/sbin/iptables -t nat -A POSTROUTING -j MASQUERADE

#qrt's SOHO server
iptables -A INPUT -p tcp -m multiport --dport 8000 -j ACCEPT
iptables -A INPUT -p tcp -m multiport --dport 8001 -j ACCEPT
iptables -t nat -A PREROUTING -d 61.161.72.211 -p tcp --dport 8000 -j DNAT --to 192.168.0.90:80
iptables -t nat -A PREROUTING -d 61.161.72.211 -p tcp --dport 8001 -j DNAT --to 192.168.0.90:21

#Disable PING HOST Server
#/sbin/iptables -A INPUT -i eth0 -p icmp -j DROP

#/sbin/iptables -t nat -A PREROUTING -j DROP

arp -f
发表于 2004-9-27 14:08:32 | 显示全部楼层
在客户机操作PING,和打开WWW有问题吗?提示如何?
service iptables stop这个不用。

完整的iptables呢?
 楼主| 发表于 2004-9-27 15:44:25 | 显示全部楼层
网内的近两百台计算机上网都没有问题。

客户机ping 和打开www ,ftp 这些都是可行的。

服务器上ping也是行的。就是不可以根据域名访问。

上边的脚本就是全部iptables的内容。
发表于 2004-9-27 16:54:34 | 显示全部楼层
检查一下,input连接是否禁止了?
 楼主| 发表于 2004-9-27 17:37:04 | 显示全部楼层
最初由 smile787 发表
检查一下,input连接是否禁止了?


谢谢版主,

能否帮我看看服务器,我的QQ:68668865

谢谢!您的联系方式?
发表于 2004-9-27 17:43:33 | 显示全部楼层
nat规则写得不对,到底谁对谁nat?
-m multiport的也不对,要多个端口。

#iptables -m multiport --help
multiport v1.2.9 options:
--source-ports port[,port,port...]
--sports ...
                                match source port(s)
--destination-ports port[,port,port...]
--dports ...
                                match destination port(s)
--ports port[,port,port]
                                match both source and destination port(s)
 楼主| 发表于 2004-9-27 18:00:03 | 显示全部楼层
我是初学的,客户机是可以上网的.

我想即使不启动iptables服务,只要配置了DNS的,也是可以打开web页的呀? 是iptables nat规则影响了吗? 不知道我的理解对不?

请各位多多指点!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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