Community discussions

MikroTik App
 
DanielT
just joined
Topic Author
Posts: 15
Joined: Wed Dec 13, 2017 6:55 pm

Closing FTP Connections in a script

Mon Nov 05, 2018 1:04 pm

Hi All,

Looking for some advice/help.

I have a few Mikrotik APs at customers now (200+) which, from a script, send me a file every 5 mins (via FTP), I have noticed that where I have multiple APs sending me files from the same venue, I am often getting 'FTP Connection refused - too many connections from IP address'. Further digging has revealed that the Mikrotik devices are opening multiple FTP connections, rather than closing a connection once a transfer is complete. So I might have 15 connections from the same device still open on the FTP server. When you have 20 devices in a large venue all coming in via the same fibre (IP address) the open connection count soon mounts up.

I've done the obvious work-arounds, increasing the number of permitted connections allowed, trying to drop the connection after timeout (which doesn't seem to work very well BTW), both from the server side, but the easiest solution would be to force close the FTP connection with a 'quit' command from within the script once the FTP - anyone know how, or if not possible can I please request the option be added to the 'fetch' function.

Thanks

Daniel