xref: /aosp_15_r20/external/curl/docs/cmdline-opts/ftp-port.md (revision 6236dae45794135f37c4eb022389c904c8b0090d)
1*6236dae4SAndroid Build Coastguard Worker---
2*6236dae4SAndroid Build Coastguard Workerc: Copyright (C) Daniel Stenberg, <[email protected]>, et al.
3*6236dae4SAndroid Build Coastguard WorkerSPDX-License-Identifier: curl
4*6236dae4SAndroid Build Coastguard WorkerLong: ftp-port
5*6236dae4SAndroid Build Coastguard WorkerArg: <address>
6*6236dae4SAndroid Build Coastguard WorkerHelp: Send PORT instead of PASV
7*6236dae4SAndroid Build Coastguard WorkerShort: P
8*6236dae4SAndroid Build Coastguard WorkerProtocols: FTP
9*6236dae4SAndroid Build Coastguard WorkerCategory: ftp
10*6236dae4SAndroid Build Coastguard WorkerAdded: 4.0
11*6236dae4SAndroid Build Coastguard WorkerMulti: single
12*6236dae4SAndroid Build Coastguard WorkerSee-also:
13*6236dae4SAndroid Build Coastguard Worker  - ftp-pasv
14*6236dae4SAndroid Build Coastguard Worker  - disable-eprt
15*6236dae4SAndroid Build Coastguard WorkerExample:
16*6236dae4SAndroid Build Coastguard Worker  - -P - ftp:/example.com
17*6236dae4SAndroid Build Coastguard Worker  - -P eth0 ftp:/example.com
18*6236dae4SAndroid Build Coastguard Worker  - -P 192.168.0.2 ftp:/example.com
19*6236dae4SAndroid Build Coastguard Worker---
20*6236dae4SAndroid Build Coastguard Worker
21*6236dae4SAndroid Build Coastguard Worker# `--ftp-port`
22*6236dae4SAndroid Build Coastguard Worker
23*6236dae4SAndroid Build Coastguard WorkerReverses the default initiator/listener roles when connecting with FTP. This
24*6236dae4SAndroid Build Coastguard Workeroption makes curl use active mode. curl then commands the server to connect
25*6236dae4SAndroid Build Coastguard Workerback to the client's specified address and port, while passive mode asks the
26*6236dae4SAndroid Build Coastguard Workerserver to setup an IP address and port for it to connect to. \<address\>
27*6236dae4SAndroid Build Coastguard Workershould be one of:
28*6236dae4SAndroid Build Coastguard Worker
29*6236dae4SAndroid Build Coastguard Worker## interface
30*6236dae4SAndroid Build Coastguard Workere.g. **eth0** to specify which interface's IP address you want to use (Unix only)
31*6236dae4SAndroid Build Coastguard Worker
32*6236dae4SAndroid Build Coastguard Worker## IP address
33*6236dae4SAndroid Build Coastguard Workere.g. **192.168.10.1** to specify the exact IP address
34*6236dae4SAndroid Build Coastguard Worker
35*6236dae4SAndroid Build Coastguard Worker## hostname
36*6236dae4SAndroid Build Coastguard Workere.g. **my.host.domain** to specify the machine
37*6236dae4SAndroid Build Coastguard Worker
38*6236dae4SAndroid Build Coastguard Worker## -
39*6236dae4SAndroid Build Coastguard Workermake curl pick the same IP address that is already used for the control
40*6236dae4SAndroid Build Coastguard Workerconnection. This is the recommended choice.
41*6236dae4SAndroid Build Coastguard Worker
42*6236dae4SAndroid Build Coastguard Worker##
43*6236dae4SAndroid Build Coastguard Worker
44*6236dae4SAndroid Build Coastguard WorkerDisable the use of PORT with --ftp-pasv. Disable the attempt to use the EPRT
45*6236dae4SAndroid Build Coastguard Workercommand instead of PORT by using --disable-eprt. EPRT is really PORT++.
46*6236dae4SAndroid Build Coastguard Worker
47*6236dae4SAndroid Build Coastguard WorkerYou can also append ":[start]-[end]" to the right of the address, to tell
48*6236dae4SAndroid Build Coastguard Workercurl what TCP port range to use. That means you specify a port range, from a
49*6236dae4SAndroid Build Coastguard Workerlower to a higher number. A single number works as well, but do note that it
50*6236dae4SAndroid Build Coastguard Workerincreases the risk of failure since the port may not be available.
51*6236dae4SAndroid Build Coastguard Worker(Added in 7.19.5)
52