Серверийн FTP port iptables дээр нээх
Дусал нэвтэрхий толь-с
21:30, 4 Долоодугаар сар 2015-ий байдлаарх Almas (Яриа | оруулсан хувь нэмэр) хэрэглэгчийн хийсэн залруулга
Your ftp server needs a channel to transfer data. Port 21
is used to establish the connection. So to make data transfer possible you'd need to enable port 20
as well. See the following configuraton
First load the following module to make sure passive ftp connections are not rejected
<code>modprobe ip_conntrack_ftp </code>
Allow FTP connections on port 21
incoming and outgoing
<code>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" </code>
Allow FTP port 20
for active connections incoming and outgoing
<code>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" </code>
Finally allow FTP passive inbound traffic
<code>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" </code>
For more on FTP and firewall problems see: http://slacksite.com/other/ftp.html#active