Page 1 of 1

CSF not working correctly with docker

Posted: 20 Dec 2020, 11:11
by panomitrius
Hi!

I've recently installed CSF on an Ubuntu server 20.04, where I also run a docker daemon. I've found that the standard docker-options in the configuration doesn't give my containers network access with adequate port forwarding. I've tried some workarounds, such as using putting

Code: Select all

service docker restart
inside csfpost.sh. That's perhaps not that elegant but it works after a fresh enable or restart with CSF. However after a couple of hours CSF updates the rules and the docker containers looses their iptables rules again and get inaccessible. What could I do to work around this?

Perhaps setting the
FASTSTART = "0"?

I'll experiment a bit more with this later when I can monitor more carefully what the effects are.

Re: CSF not working correctly with docker

Posted: 10 Jan 2021, 08:40
by panomitrius
I found a solution, using this script: https://github.com/juli3nk/csf-post-docker, but modifying it and providing the full path to each iptables and docker command. Perhaps this could be integrated into the default CSF docker configuration?

Re: CSF not working correctly with docker

Posted: 04 Feb 2021, 12:26
by klodoma
I am also using:https://github.com/juli3nk/csf-post-docker

I am currently setting up a new server and I am wondering if there is already something build in csf to cover this case?

Re: CSF not working correctly with docker

Posted: 24 Feb 2021, 11:29
by marketinglootsale
Script is not running correctly when CSF refreshes the rules automatically, but works fine when used together with csf -r. #19