There are a lot of network-related settings in /etc/sysctl.conf and a number of files in /etc/sysctl.d/. My data centre operator who has preconfigured the Ubuntu OS to work best in their environment has also added a custom file in there. I guess they come in a good state with the OS and I only need to make changes there if I have good reasons to do so. I don't fully understand all the details about the security issues they may cover so I'd rather not touch them.
When I enable the firewall UFW (uncomplicated firewall), its config file says it will override these settings with its own copy in /etc/ufw/sysctl.conf.
I have two questions regarding to that:
Does this mean that all existing settings in the /etc/sysctl.conf file and /etc/sysctl.d/* files are completely ignored and only /etc/ufw/sysctl.conf is ever regarded? Or will anything mentioned in /etc/ufw/sysctl.conf just override the other existing settings (and nothing will happen if I comment away or delete all of its lines)?
Why is a separate file used at all? The old files are still in place but possibly/partially unused or ineffective. That seems like very bad practice and a big source of errors and confusion. It is documented how I could stop this behaviour and switch back to the default file (it's unclear though what then happens to /etc/sysctl.d/*). Why should I not do this? And why is this not the default already?
I couldn't find any information about these topics online. There are many places that explain that there are separate files with UFW and I should edit them instead. But noone explains why. I cannot make decisions without knowing the effects.