500 PORT illégal rejeté (adresse incorrecte).
avion-f16 Posted messages 19182 Registration date Status Contributor Last intervention -
Hello,
I would need a little help if possible.
I have launched an FTP server on a podman container linked to my local VM.
When I connect to it from my container (using ftp 127.0.0.1), I can transfer my files and everything goes well. However, when I connect to it from my local VM (thus from outside the container, still using the same command ftp 127.0.0.1), I can no longer transfer a file and I get the following error:
500 Illegal PORT rejected (address wrong).
ftp: bind: Address already in use
Could you help me solve this problem?
Best regards, Name removed Moderation CCM
Thank you in advance
2 answers
-
Hello,
It seems that the issue you are experiencing with your FTP server is related to a misconfiguration of the passive communication (passive mode) of the server.
In passive mode, the FTP server opens dynamic ports for data transmission, which requires the configuration of firewalls and NAT (Network Address Translation). In your case, it seems that the passive mode configuration is not allowing your FTP client to connect properly to the FTP server.
To resolve this issue, you can try the following steps:
-
Modify the settings of your FTP server to use a specific range of passive ports. For example, you can configure your server to use ports 60000 to 60010 for passive transmissions.
-
Open the specified ports in your VM's firewall to allow passive traffic.
-
Configure your FTP server to use a public IP address instead of the local IP address (127.0.0.1). You can find your public IP address using websites like WhatIsMyIP.com.
-
Ensure that the IP addresses of the network interfaces used by your VM and your FTP server are correctly configured.
-
Also, make sure that the FTP service is properly configured and that the port used for passive transmissions is correctly specified in the configuration.
If you are still having trouble resolving this issue, you may want to post more information about your FTP server configuration, including details of your server setup and the complete error messages you are receiving.
-
-
Hello,
Podman containers use their own network namespace. Therefore, the meaning of the loopback address (127.0.0.1) is different inside the container and outside.
For example, you can bind a vsftpd in the container to 127.0.0.1:21 even if you already have a pureftpd listening on that address at the host level.
You could access the FTP from the host by creating a mapping between the host ports (and the public or loopback address depending on your needs) and the container ports (using the --publish or -p option of the "podman run" command).
Your virtual machine does not share either the network namespace of the host or that of the container. The address 127.0.0.1 in its context does not have any FTP service.
To access the FTP from the VM, you need to expose the container port on one of the host's addresses/ports that is accessible by the virtual machine.