I have a device with a FTP server installed on it (it's an embedded device, so I can set few parameters on it) and it's connected to the internet through a RUT955 with a public IP address. I successfully set the firewall so I can connect to the FTP server without any problem. Now I have to activate an FTP push functionality on the same device (the device has only to upload some files to a remote public FTP server), but I struggled to made it work; finally the only thing that worked was to disable the inbound port forwarding for the port 21 to the device (I don't understand why, but that's it). The problem now is to make to work the device FTP server again; I tried to change the port from 21 to another one, at first I changed the forwarding on the router then also the internal port of the device but in both cases I could only connect and login then every other commands failed with these errors:
229 Entering Extended Passive Mode (|||33143|)
ftp: Can't connect to `XXX.XXX.XXX.XXX:33143': Connection refused
500 Illegal PORT command
ftp: Can't bind for data connection: Address already in use
(XXX.XXX.XXX.XXX is the public IP address)
I know there is a FTP passive connection tracking (FTP) which I previously enabled, this conntrack helper maybe works fine only with the standard port? Does anyone know what can I try to do to make the inbound and outbound FTP connections working at the same time?