PORT (Data Port)

The PORT IBM® i FTP server subcommand identifies the data port on which the client will listen for a connection.

FTP server subcommand

PORT h1,h2,h3,h4,p1,p2

h n
Represents the system IP address and is a character string that is a decimal value between 0 and 255.
p n
Represents the TCP port number and is a character string that is a decimal value between 0 and 255.

To convert the p1 and p2 values to a TCP port number, use this formula:

    port = ( p1 * 256 ) + p2

For example, in this PORT subcommand:

   PORT 9,180,128,180,4,8

the port number is 1032 and the IP address is 9.180.128.180.

Note: After it closes the connection, the FTP server cannot connect to the same client IP address and port number until a two-minute time delay has occurred as specified in TCP/IP Request for Comments (RFC) 1122. The FTP server can make a connection to the same client IP address on a different port number without this restriction.