sysctl.conf - persistent parameter settings ?
I am having problems making my kernel parameters persistent across re-boots.
In my case the parameter "net.ipv4.ip_forward" is set to "1" and I would like it to be set to "0".
Updated the "/etc/sysctl.conf" with the line "net.ipv4.ip_forward = 0".
Ran "sysctl -p".
Confirmed that the "1" had changed to "0".
Re-booted
And "net.ipv4.ip_forward" had been set back to "1".
There are several items I would like to know:
-) Where is the "1" setting coming from ?
-) From research (Googly) it seems to indicate that running "sysctl -p" / "sysctl.conf" is the correct way to go, did I miss something?
-) Does "sysctl -p" store the value elsewhere?
RHEL 7.3 Maipo
Attached are screen prints of my activity.
Responses
Did you check the files in /etc/sysctl.d/ ? New in RHEL 7 - at boot time, sysctl now reads /etc/sysctl.conf and /etc/sysctl.d/* (in sequential order). If a parameter is set in multiple files, the last setting wins, so your change to /etc/sysctl.conf may have been overridden by /etc/sysctl.d/99-sysctl.conf (or another file in that directory).
Also, check the 'sysctl' man page; 'sysctl -p' reads /etc/sysctl.conf but does not read all of /etc/sysctl.d/* (so your command-line invocation did not mimic boot-time behavior). 'sysctl --system' parses all config files in the same manner as the boot-time process.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
