LinuxSir.cn,穿越时空的Linuxsir!

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

看看IPTABLES对本机(单机)的安全设置,

[复制链接]
发表于 2003-5-25 23:49:22 | 显示全部楼层 |阅读模式
机子上网,QQ,都行,但外面不能PING我,也不能访问我的FTP,ssh,,,,,,
我已经加了让外面访问本机ftp,ssh那两条语句呀,怎么不行,
试了一个上午,还是不管用,怎么看那些规则都没写错呀,然倒是顺序有错,还是???

itables -F OUTPUT
iptables -F FORWARD
iptables -F INPUT

iptables -P INPUT DROP

iptables -A INPUT -p tcp --dport 21 -i ppp0 -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -i ppp0 -j ACCEPT


iptables -A INPUT -i ppp0 -m state --state ESTABLISHED,RELATED -j ACCEPT

iptables -P OUTPUT ACCEPT

iptables -P FORWARD DROP

iptables -A INPUT -p tcp --dport 21 -i ppp0 -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -i ppp0 -j ACCEPT
 楼主| 发表于 2003-5-25 23:50:45 | 显示全部楼层
呵呵,错了,楼上最后两行红字在firewall脚本里是没有了,发贴的时候搞错掉~~~
 楼主| 发表于 2003-5-25 23:52:17 | 显示全部楼层
我再发一篇吧,
itables -F OUTPUT
iptables -F FORWARD
iptables -F INPUT

iptables -P INPUT DROP

iptables -A INPUT -p tcp --dport 21 -i ppp0 -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -i ppp0 -j ACCEPT


iptables -A INPUT -i ppp0 -m state --state ESTABLISHED,RELATED -j ACCEPT

iptables -P OUTPUT ACCEPT

iptables -P FORWARD DROP
 楼主| 发表于 2003-5-26 00:08:41 | 显示全部楼层
这是iptables -L后的结果:

[root@walin root]# iptables -L
Chain INPUT (policy DROP)
target     prot opt source               destination
ACCEPT     tcp  --  anywhere             anywhere           tcp dpt:ftp
ACCEPT     tcp  --  anywhere             anywhere           tcp dpt:ssh
ACCEPT     all  --  anywhere             anywhere           state RELATED,ESTABLISHED

Chain FORWARD (policy DROP)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Chain RH-Lokkit-0-50-INPUT (0 references)
target     prot opt source               destination
ACCEPT     udp  --  dns.fz.fj.cn         anywhere           udp spt:domain dpts:1025:65535
ACCEPT     udp  --  dns.smptt.fj.cn      anywhere           udp spt:domain dpts:1025:65535
ACCEPT     udp  --  192.168.0.1          anywhere           udp spt:domain dpts:1025:65535
ACCEPT     all  --  anywhere             anywhere
REJECT     tcp  --  anywhere             anywhere           tcp dpts:0:1023 flags:SYN,RST,ACK/SYN reject-with icmp-port-unreachable
REJECT     tcp  --  anywhere             anywhere           tcp dpt:nfs flags:SYN,RST,ACK/SYN reject-with icmp-port-unreachable
REJECT     udp  --  anywhere             anywhere           udp dpts:0:1023 reject-with icmp-port-unreachable
REJECT     udp  --  anywhere             anywhere           udp dpt:nfs reject-with icmp-port-unreachable
REJECT     tcp  --  anywhere             anywhere           tcp dpts:x11:6009 flags:SYN,RST,ACK/SYN reject-with icmp-port-unreachable
REJECT     tcp  --  anywhere             anywhere           tcp dpt:xfs flags:SYN,RST,ACK/SYN reject-with icmp-port-unreachable
发表于 2003-5-26 00:49:14 | 显示全部楼层
第一行就有拼写错误啦,不过可能是这里打错了,呵呵
 楼主| 发表于 2003-5-26 07:57:19 | 显示全部楼层
呵~~
是呀,是发贴的时候打错了,我是把整个规则写/etc/rc.d/firewall里面,
chmod u+x firewall

运行 firewall后没有任何 错误 提示
 楼主| 发表于 2003-5-27 19:32:32 | 显示全部楼层
顶顶顶
发表于 2003-5-28 10:35:25 | 显示全部楼层
这个是最高级别的吧。。谁能解释一下
尤其是Chain RH-Lokkit-0-50-INPUT (0 references)下面的内容
 楼主| 发表于 2003-5-29 12:39:08 | 显示全部楼层
为什么没有办法访问???
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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