I have a PC on which I have a FTP server installed. I want to set the iptables rules to allow both active and passive FTP. I\'ve tried the following code that people report is w
The arguments for the INPUT and OUTPUT lines need to be flipped in the # Allow FTP connections @ port 21 section otherwise new (active) FTP connections will be blocked.
# Allow FTP connections @ port 21
$IPT -A INPUT -p tcp --dport 21 -m state --state NEW,ESTABLISHED -j ACCEPT
$IPT -A OUTPUT -p tcp --sport 21 -m state --state ESTABLISHED -j ACCEPT