Don’t know if that has something to do with incus.
I’m running sftpgo inside a container and the wget client in a script can’t reach 127.0.0.1:50045 for pasv. Thats clear so far. I’ve forwared 50000-50100 to the container. (and 21) But wget means it should use the local ip. A filezilla client detect it and used the fqdn instead and it works. But wget not.
How are you doing the forwarding? Through a proxy device?
If so, then indeed the default proxy device (without either proxy_protocol or nat) will make it look like a connection is coming from localhost, which in a protocol using multiple connections like FTP can be an issue as the address returned to the remote client would be wrong.
If you can use nat=true on your device, that’d probably be the easiest way out of this as I don’t think there’s any FTP server which supports the haproxy proxy_protocol header stuff (though I may be wrong there).
The sftpgo application has a webgui, what is reachable via a caddy reverse proxy. And the needed ftp ports are forwarded as followed. The range 50000-50100 is needed for pasv.
How to and what changed when enabling nat?
Edit the instance and set ipv4.address on its network interface (usually eth0), you can set it to the current value see in incus list. This will ensure the address can’t change again which is a requirement for NAT.
Edit the instance config and set nat: true on all of the proxy devices
Thanks. I will try it now, but I sometimes have difficulties putting the command together. Sometimes it’s easier to edit things in config files than to know in which order which commands have to be given.
Sometimes it would be helpful to give an example in the documentation, to explain what is needed here.
For expl. Is remote the ip and network eth0 …?
incus network set [<remote>:]<network> <key>=<value>... [flags]
By the way. These are the messages from the client filezilla… I’m asuming that means the client cannot reach via port 500xx the server…?!
The settings from sftpgo for ftp:
FTP server
Status: "Started"
Address: ":2021"
TLS: "Disabled"
Passive port range: "50000-50100"
Filezilla:
Status: Verbinde mit 213.109.xxx.xx:2021...
Status: Verbindung hergestellt, warte auf Willkommensnachricht...
Status: Unverschlüsseltes FTP ist unsicher. Bitte wechseln Sie zu FTP über TLS.
Status: Angemeldet
Status: Empfange Verzeichnisinhalt...
Status: Vom Server gesendete Adresse für den Passiv-Modus ist nicht routingfähig. Benutze stattdessen die Serveradresse.
Befehl: MLSD
Antwort: 425 data connection security requirements not met
Fehler: Verzeichnisinhalt konnte nicht empfangen werden
OK, it seems it works now. My problem was, that the ftp server was sending the localhost ip for pasv mode to the client, where clients like filezilla are able to detekt this and switch to the public address. But in my ftp scripts with wget that won’t work.
The idea to use a nat hasn’t work at the first attempt. I’m not sure, if i had setup the nat correctly to be honest. I’ve posted the output above, maybe @stgraber, u could say if that was correct.
In the meantime i found a solution to force the ftp server so send the public ip as a pasv destination. And i removed the natted proxy an used the one without…
This is the SFTPGO config with the exportvariables… If someone is interessted. (running on VoidLinux)
(Last export line…) https://sftpgo.com/