curl -P [arg]
(also known as --ftp-port
in long form) and while the option allows you to specify exactly which address to use, just setting the same as you come from is almost always the correct choice and you do that with -P -
, like this way to ask for a file:--no-eprt
command-line option.--ftp-pasv
.--no-epsv
command-line option.--ftp-skip-pasv-ip
) and instead use the same IP address it has for the control connection even for the second connection.