Active vs. Passive Mode in FTP
Active vs. Passive Mode in FTP
FTP uses two channels for communication:
Command Channel – Used for sending commands and responses.
Data Channel – Used for transferring files.
Active Mode (Default FTP Mode)
The client connects to the server’s port 21 (Command Channel).
The server then initiates a connection from its port 20 to the client’s dynamic port (Data Channel).
This can be blocked by client-side firewalls since the incoming connection from the server is often treated as suspicious.
Passive Mode (Recommended for NAT & Firewalls)
The client connects to the server’s port 21 (Command Channel).
Instead of the server initiating the Data Channel, it provides a random port range for the client to connect.
The client initiates the Data Channel connection, which bypasses client-side firewalls and NAT restrictions.
Last updated
Was this helpful?