FTP Active Mode PORT
The client logs on to the FTP client to connect to port 21 on the server
After successful login, the client randomly distributes a high port for listening (greater than 1024) and notifies the FTP
FTP received the client's notification after using a (N-1 that is, the FTP port minus 1 of the port FTP is 21 so here is 20) port to the client specified high-end port transfer data
20-Port and 21-port open in Iptables
Iptables -I INPUT -p TCP --dport 20-j ACCEPT
Iptables -I INPUT -p TCP --dport 21-j ACCEPT
FTP Passive Mode PASV
When the client connects to FTP, the FTP server randomly assigns a port to transmit the data requested by the client.
The port range specifies an FTP profile within the FTP configuration file:/etc/Vsftpd/Vsftpd.conf
In/etc/Vsftpd/Find Inside Vsftpd.conf
Pasv_min_port=50000Randomly assigned minimum port
Pasv_min_port=60000Randomly assigned maximum port
Also need to set the corresponding port in the Iptables
Iptables-I INPUT-P TCP--dport 50000:60000-j ACCEPT
FTP Active mode passive mode