Custom sysctl settings - where?

In most guides (including in the firewall guide on this site) it is recommended to add any custom sysctl settings to /etc/sysctl.conf. However, it seems that such settings could also be added to /etc/sysctl.d/local.conf (or any *.conf file in that directory). Both files are included in the backup file list by default.

Are there any downsides to using the local.conf file instead of the main sysctl.conf since the latter seems to be the recommended method? I think perhaps it is a bit cleaner to use the local.conf, as that file would then only contain the added user settings.

Perhaps this is a dumb question, but I'm asking it anyway, as I don't know the answer.

i think /etc/sysctl.d/* generally gets picked up at boot while /etc/sysctl.conf doesnt. also think it wouldnt matter where you place it however if its picked up at boot there can be trouble changing values from userspace after. im not a 100% sure a quick google search will tell you exactly whats going on. no dumb questions, linux is complex. too much to learn.

1 Like
root@OpenWrt:~# cat /etc/sysctl.conf 
# Defaults are configured in /etc/sysctl.d/* and can be customized in this file

So this answers the inquiry of where "custom sysctl settings" should be placed.

@anon75569510 - no reason to revive a 5 year old thread - this (info outlined in the file) has actually changed (added) since the question was posted.