|
楼主 |
发表于 2003-6-5 12:51:22
|
显示全部楼层
解决问题的暂行办法:
加iptables -A INPUT -i lo -j ACCEPT 让,服务器ping通127.0.0.1
加iptables -A INPUT -p icmp -j ACCEPT 让服务器ping通外网的任意节点
在上面对应于每个端口控制时,加一条语句:
iptables -A INPUT -p tcp --sport 21 -j ACCEPT
现在我的规则如下:
iptables -F
iptables --table nat --flush
iptables --table nat --delete-chain
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -A INPUT -p all -d 192.168.102.0/24 -j ACCEPT
iptables -A INPUT -p all -s 192.168.102.0/24 -j ACCEPT
iptables -A INPUT -p tcp --dport 21 -j ACCEPT
iptables -A INPUT -p tcp --sport 21 -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -p tcp --sport 22 -j ACCEPT
iptables -A INPUT -p tcp --dport 25 -j ACCEPT
iptables -A INPUT -p tcp --sport 25 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp --sport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 110 -j ACCEPT
iptables -A INPUT -p tcp --sport 110 -j ACCEPT
iptables -A INPUT -f -j ACCEPT
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -p icmp -j ACCEPT
经过我检查:
服务器可以ping通任何节点,亦可访问外网节点的80,21,25,110.
局域网内主机可以ping通任何节点,亦可访问服务器或外网节点的80,21,25,110
外网节点可以ping通服务器,也可以访问服务器的80,21,25,110
但局域网内的主机还没有检查能否使用QQ等使用udp协议的情况
稍等,检查后再贴出来。
to: stanlogin 期待你的文章啊,,,
还有,能不能帮我检查一下我的规则是否有漏洞??我马上就要交差了:) |
|