SonicWall configuration for Active Mode FTP client connections with client behind the SonicWall
05/15/2024 63 People found this article helpful 487,645 Views
Description
Feature/Application:
FTP connections involve two TCP connections - one for Control and another for Data. In the Control phase of the connection the client and the server exchange authentication information; send and receive FTP commands on TCP port 21. The Data phase is used to transfer files. The port used for FTP-Data connection is determined by the mode the FTP server is configured in. FTP can be configured in either Active or Passive mode. In either mode the Control port is by default TCP port 21.
In Active mode, the Data connection is almost always on TCP port 20 though some vendors (eg. FileZilla) are known to use a random >1023 TCP port. After the Control connection is established, the client sends a PORT command to the server. Basically this command tells the server to which IP address and port number (> 1023) the server must connect back for the data connection. After accepting the Port command, the server will then establish the data connection from its local data port 20 (the IANA assigned default port number) to the IP address and port number learned from the PORT command. Such data connections made by the server to the client are separate inbound connections since the client does not make the data connection but instead only tells the port to which the server must connect.
Resolution
Resolution for SonicOS 6.5
This release includes significant user interface changes and many new features that are different from the SonicOS 6.2 and earlier firmware. The below resolution is for customers using SonicOS 6.5 firmware.
To be SonicWall specific, if a client is behind the SonicWall and the server is on the WAN side of the SonicWall, this inbound data connection would be dropped.
The SonicWall solution to overcome this problem - of Active mode client connections from behind the SonicWall to an FTP server on the WAN - is to scan FTP traffic using DPI and dynamically open the port specified in the PORT command to allow the server to connect back to the client.
In such scenarios, if the default LAN to WAN default Allow rule is in place, no ports need be opened in the SonicWall. If the default LAN to WAN has been modified and is not open for all, then TCP port 21 requires to be explicitly opened in the SonicWall.
FTP Transformation
The option Enable FTP Transformations for TCP port(s) in Service Object under Manage | Firewall Settings | Advanced Settings allows you to choose the Control port used in the FTP connection. This option does the following:
- Enables the SonicWall to track the FTP connection to obtain the Data port sent by the FTP client to the FTP server.
- Then dynamically open the port to allow the FTP server to connect to the FTP client.
By default, this option is pre-selected with the service object FTP (TCP port 21). However, if the Control port is a non-standard custom port, specify it here. Refer this article for Opening custom port for a Passive mode FTP Server behind the SonicWall
NOTE: Selecting the wrong object here will break the FTP connection.This option is available only in Gen5 devices.
Resolution for SonicOS 6.2 and Below
The below resolution is for customers using SonicOS 6.2 and earlier firmware. For firewalls that are generation 6 and newer we suggest to upgrade to the latest general release of SonicOS 6.5 firmware.
To be SonicWall specific, if a client is behind the SonicWall and the server is on the WAN side of the SonicWall, this inbound data connection would be dropped.
The SonicWall solution to overcome this problem - of Active mode client connections from behind the SonicWall to an FTP server on the WAN - is to scan FTP traffic using DPI and dynamically open the port specified in the PORT command to allow the server to connect back to the client.
In such scenarios, if the default LAN to WAN default Allow rule is in place, no ports need be opened in the SonicWall. If the default LAN to WAN has been modified and is not open for all, then TCP port 21 requires to be explicitly opened in the SonicWall.
FTP Transformation
The option Enable FTP Transformations for TCP port(s) in Service Object under Firewall Settings|Advanced allows you to choose the Control port used in the FTP connection. This option does the following:
- Enables the SonicWall to track the FTP connection to obtain the Data port sent by the FTP client to the FTP server.
- Then dynamically open the port to allow the FTP server to connect to the FTP client.
By default, this option is pre-selected with the service object FTP (TCP port 21). However, if the Control port is a non-standard custom port, specify it here. Refer this article for Opening custom port for a Passive mode FTP Server behind the SonicWall
NOTE: Selecting the wrong object here will break the FTP connection.This option is available only in Gen5 devices.
Related Articles
Categories