LinuxSir.cn,穿越时空的Linuxsir!

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

Debian下iptables的奇怪问题, 盼解

[复制链接]
发表于 2005-9-30 15:37:00 | 显示全部楼层 |阅读模式
发表于: 2005-09-30 13:17    发表主题: debian下iptables的设置问题,好奇怪      

--------------------------------------------------------------------------------

我设置了一个脚本
#!/bin/bash
IPT="/sbin/iptables -v"
IPTS="/sbin/iptables-save"
IPTR="/sbin/iptables-restore"
EXTIF="ppp0"
INTIF="eth0"
LO_IFACE="lo"
LO_IP="127.0.0.1"

# Flush all rules
$IPT -F
$IPT -t nat -F
$IPT -t mangle -F

# Erase all non-default chains
$IPT -X
$IPT -t nat -X
$IPT -t mangle -X


$IPT -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE

如果中间红色部分有的话,脚本执行后客户端大部分网站都能访问,但www.chinaunix.netwww.icbc.com.cn等一些网站可以ping得通,就是长时间打不开网页,如果去掉红色部分就可以了, 为什么?

我的系统是debian3.1,iptables 1.211


----------------------------------------
如果没有红色部分

#iptables -t nat -L
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination         

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination         
MASQUERADE  all  --  anywhere             anywhere            

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         



#iptables -nvL
Chain INPUT (policy ACCEPT 473 packets, 50608 bytes)
pkts bytes target     prot opt in     out     source               destination         

Chain FORWARD (policy ACCEPT 5003 packets, 1611K bytes)
pkts bytes target     prot opt in     out     source               destination         
266 12768 TCPMSS     tcp  --  *      ppp0    0.0.0.0/0            0.0.0.0/0           tcp flags:0x06/0x02 tcpmss match 1400:1536 TCPMSS clamp to PMTU

Chain OUTPUT (policy ACCEPT 449 packets, 46298 bytes)
pkts bytes target     prot opt in     out     source               destination   


有了红色的部分 那条绿的FORWARD就没有了!
发表于 2005-9-30 17:16:24 | 显示全部楼层
在脚本运行前后都运行一下,看看结果是什么, 以前应当修改过iptables 吧.
iptables -L
iptables -t nat -L
iptables -t mangle -L


客户端是指这一台Debian3.1还是另外的机子?
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

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