Read an EPRT endpoint without IPv4 assumptions
02EPRT describes an address family, a network address and a listening TCP port, separated by one chosen printable delimiter.
A separate command missing its final bar is malformed. The chosen server rejects it with 501 before accepting an endpoint.
Key idea: The delimiter separates fields; colons inside an IPv6 address stay inside its address field.
Terms
- FTP
- File Transfer Protocol. Its control connection carries commands; a separate data connection carries a file or directory listing.
- Client / server
- The client sends FTP commands. Which side opens the data TCP connection is a separate choice.
- Address family
- The network protocol number: 1 for IPv4 and 2 for IPv6 in these examples.
- Passive mode
- The server listens for a data TCP connection that the connecting peer opens.
Rules & examples
The delimiter separates fields; colons inside an IPv6 address stay inside its address field.
- EPRT MUST be followed by one ASCII space, then the chosen delimiter and the three fields, each followed by that delimiter: EPRT <d><net-prt><d><net-addr><d><tcp-port><d>. FTP commands end with CRLF (RFC 959 §4.1.3).
- The delimiter MUST be ASCII 33–126 inclusive. The vertical bar | is RECOMMENDED unless it conflicts with a character needed in the network address. A delimiter must still permit the chosen fields to be read unambiguously.
- The network protocol field MUST be an assigned address-family number. The shown families are 1 for IPv4 dotted decimal and 2 for IPv6 textual addresses. IPv6 colons are not PORT-style comma-separated IPv4 octets.
- The port is the decimal TCP listening-port number. A well-formed supported endpoint is not proof of authorization, identity or reachability. The malformed example chooses standard negative reply 501; RFC 2428 also permits 500 for relevant errors.
Documentation addresses and chosen listening ports. Each chapter is a separate bounded example; FTP authentication, authorization, file commands and transfer replies are not a complete FTP implementation here. EPRT/EPSV provide no encryption or guaranteed reachability.
Sources
New to this? Start hereA quick picture + helpful background
Commands arrange a separate file connection
Imagine arranging a delivery by phone, then opening a separate delivery entrance. EPSV asks the server to listen; EPRT can describe another receiving endpoint in a proxy setup. The analogy separates arranging a connection from moving the file and does not promise access through a firewall.
Helpful first, if these ideas are unfamiliar
These pictures are analogies to help you learn. The linked RFC explains the actual rules.
Related RFCs and changes
“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.