【发布时间】:2014-12-26 20:40:45
【问题描述】:
我在 CentOS6 上安装了 ProFTPD 服务器。 如果我使 ftp localhost,我可以正确连接,但如果我从外部尝试,我会收到消息“没有到主机的路由”。但是有一条主机路由,因为我是通过 SSH 连接的。
我尝试添加以下 iptable 规则:
iptables -A INPUT -p tcp -m tcp --dport 21 -m conntrack --ctstate ESTABLISHED -j ACCEPT -m comment --comment "Allow ftp connections on port 21"
iptables -A OUTPUT -p tcp -m tcp --dport 21 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT -m comment --comment "Allow ftp connections on port 21"
iptables -A INPUT -p tcp -m tcp --dport 20 -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT -m comment --comment "Allow ftp connections on port 20"
iptables -A OUTPUT -p tcp -m tcp --dport 20 -m conntrack --ctstate ESTABLISHED -j ACCEPT -m comment --comment "Allow ftp connections on port 20"
iptables -A INPUT -p tcp -m tcp --sport 1024: --dport 1024: -m conntrack --ctstate ESTABLISHED -j ACCEPT -m comment --comment "Allow passive inbound connections"
iptables -A OUTPUT -p tcp -m tcp --sport 1024: --dport 1024: -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT -m comment --comment "Allow passive inbound connections"
并重新启动 proftpd 和 iptables 服务。 我该怎么做才能解决这个问题?
【问题讨论】:
标签: linux ftp iptables centos6 proftpd