barryzhong
[在线求助][急]Linux网关可以访问外网,但是外网无法PINGLinux主机
网络结构
ADSL调制解调器
|
|
交换机
|
|
-----------------------------------------------
| | |
| | |
| | |
Linux网关 XP主机 XP主机
(单网卡)
通过pppoe-setup设置了ADSL并选择了MASQUEADING的防火墙设置
1.子网内XP主机可上网,但Linux网关不可上网,发现INPUT链默认为DROP
执行iptables -P INPUT ACCEPT
2.子网内xp主机和Linux网关都可以上网了,此时发现除了INPUT链中有规则,其他都没有规则,且默认值为ACCEPT。
INPUT链中有的规则为DROP,有的为ACCEPT,默认为ACCEPT.
问题:目前为2的状态,并且外网不能访问Linux主机,PING不通,7001,8080,80,3700.....22,所有端口都连不上,应该如何修改呢?
Chain INPUT (policy ACCEPT)
target prot opt source destination
LOG tcp -- anywhere anywhere tcp dpts:0:1023 LOG level warning
LOG udp -- anywhere anywhere udp dpts:0:1023 LOG level warning
DROP tcp -- anywhere anywhere tcp dpts:0:1023
DROP udp -- anywhere anywhere udp dpts:0:1023
LOG udp -- anywhere anywhere udp dpt:nfs LOG level warning
LOG tcp -- anywhere anywhere tcp dpt:nfs LOG level warning
DROP udp -- anywhere anywhere udp dpt:nfs
DROP tcp -- anywhere anywhere tcp dpt:nfs
LOG tcp -- anywhere anywhere tcp dpts:x11:6063 LOG level warning
DROP tcp -- anywhere anywhere tcp dpts:x11:6063
LOG tcp -- anywhere anywhere tcp dpt:xfs LOG level warning
DROP tcp -- anywhere anywhere tcp dpt:xfs
LOG tcp -- anywhere anywhere tcp flags:FIN,SYN,RST,ACK/SYN LOG level warning
DROP tcp -- anywhere anywhere tcp flags:FIN,SYN,RST,ACK/SYN
DROP icmp -- anywhere anywhere icmp echo-request
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain RH-Firewall-1-INPUT (0 references)
target prot opt source destination
[[i] 本帖最后由 barryzhong 于 2008-5-19 12:12 编辑 [/i]]
platinum
[quote]原帖由 [i]barryzhong[/i] 于 2008-5-19 13:54 发表 [url=http://linux.chinaunix.net/bbs/redirect.php?goto=findpost&pid=6589462&ptid=1003780][img]http://linux.chinaunix.net/bbs/images/common/back.gif[/img][/url]
谢谢了!
已经搞定了!
我把OUTPUT链的相关源端口打开了!谢谢! [/quote]
有意义吗?你原来默认就是 ACCEPT 的,又添加特殊的 ACCEPT 策略非但对你的问题丝毫起不到作用还等同于脱了裤子放屁
你的问题虽然解决了,但我敢保证绝对不是你说的这种可能
liwensi
[quote]原帖由 [i]platinum[/i] 于 2008-5-19 16:11 发表 [url=http://linux.chinaunix.net/bbs/redirect.php?goto=findpost&pid=6589581&ptid=1003780][img]http://linux.chinaunix.net/bbs/images/common/back.gif[/img][/url]
有意义吗?你原来默认就是 ACCEPT 的,又添加特殊的 ACCEPT 策略非但对你的问题丝毫起不到作用还等同于脱了裤子放屁
你的问题虽然解决了,但我敢保证绝对不是你说的这种可能 [/quote]
版主的回复还是那么的火爆。。。 但是说的有道理
我觉得一定是input里面的原因,楼主可以把带drop的去掉试试看。就另外,最好吧 iptables -L -n -v 的结果贴出来看得清楚。。