Skip to main content

*Outgoing* FTP connections failing with CSF firewall enabled

Comments

2 comments

  • device68
    *UPDATE* It seems I've managed to largely solve the issue by adding the following: First it looks like what was needed to ultimately get connections working, was to add the passive ports in the TCP_OUT box. CSF Config now looks like: # Allow incoming TCP ports TCP_IN = "20,21,22,2211,25,53,80,110,143,443,465,587,993,995,2077,2078,2079,2080,2082,2083,2086,2087,2095,2096,8443,49152:65534,30000:50000" # Allow outgoing TCP ports TCP_OUT = "20,21,22,2211,25,37,43,53,80,110,113,443,587,873,993,995,2086,2087,2089,2703,49152:65534,30000:50000"
    I removed the previously mentioned entry to IP tables and left this as it was by default as further tests found this had no affect. Lastly I updated PureFTP Config to included the lower limit for the ports so it has a wider range: PassivePortRange: 30000 65534
    Although the lower range of 30000 - 50000 wasn't needed to solve the problem with the tests I was running (the issue was the missing 49152:65534), I've factored them in just incase some servers are querying a port in the lower limit. No idea if that's even a valid point, but no major harm I guess. Overall this may seem reasonably obvious. I had looked at the TCP_OUT field a number of times and did feel that maybe something needed to go there as the regular ports were present, but I only recently found an ariticle that stipulated the passive ports should go there as well just as a general rule of setting up Passive FTP with CSF. Most other articles just focused on the TCP_IN field. Having said that I think most people are concerned with connecting to their server via FTP, and not specifically sending data out via FTP as in my case. Anyway, hopefully this helps someone trying the same thing as me.
    0
  • cPanelLauren
    The Passive Ports you added later are indeed the correct Passive ports - what's in CSF should match the default for FTP in /etc/pure-ftpd.conf (or pro if you're using that) I am glad to see you resolved that though and thanks for updating with the solution!
    0

Please sign in to leave a comment.