在CentOS 6.4中设置防火墙

我需要询问有关安装某些软件包的一般性问题,以及需要在centOS中进行iptable调整的问题。 当我安装了Apache包,并把一个简单的testing页面放在/ var / www / html,它不想拉起来,直到我真的去了IPTables,并添加一行来打开端口80.我现在有同样的问题设置ftp&vsftpd。 他们虽然更固执 我已经将端口20和21添加到了iptables,我仍然被拒绝。 我停止了iptables,并能够获得FileZilla连接。

我的一个同事告诉我,我甚至不需要这样做。 只是安装软件包应该照顾所有的configuration设置。 他是对的吗? centOS6.4还是如此新,它有缺陷?

我已经回顾了一些关于设置vsftpd的文档,但是它们有所不同。

帮助赞赏。

这是我从iptables的输出:

Chain INPUT (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination 0 0 ACCEPT tcp -- any any anywhere anywhere tcp dpt:ftp 0 0 ACCEPT tcp -- any any anywhere anywhere tcp dpt:ftp-data 0 0 ACCEPT tcp -- any any anywhere anywhere tcp dpt:https 6 725 ACCEPT tcp -- any any anywhere anywhere tcp dpt:http 20 1376 ACCEPT all -- any any anywhere anywhere state RELATED,ESTABLISHED 0 0 ACCEPT icmp -- any any anywhere anywhere 0 0 ACCEPT all -- lo any anywhere anywhere 0 0 ACCEPT tcp -- any any anywhere anywhere state NEW tcp dpt:ssh 557 91720 REJECT all -- any any anywhere anywhere reject-with icmp-host-prohibited Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination 0 0 REJECT all -- any any anywhere anywhere reject-with icmp-host-prohibited Chain OUTPUT (policy ACCEPT 18 packets, 3833 bytes) pkts bytes target prot opt in out source destination 0 0 ACCEPT tcp -- any any anywhere anywhere tcp dpt:ftp-data 0 0 ACCEPT tcp -- any any anywhere anywhere tcp dpt:ftp 

您错过了一个规则来接受基于现有stream量的stream量(使iptables有状态的规则)。 这应该是你的第一条规则:

 -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT