How do I permanently change a kernel parameter/tunable on redhat?
africaele Banned last edited by africaele
Refer to the readme important notes first. README.
Permanently changing kernel parameters requires them to be saved to a file, generally for the system in
/etc/sysctl.conf; also note the comments in the
/etc/sysctl.d/99-sysctl.confis a symbolic link to
# sysctl settings are defined through files in # /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/. # # Vendors settings live in /usr/lib/sysctl.d/. # To override a whole file, create a new file with the same in # /etc/sysctl.d/ and put new settings there. To override # only specific settings, add a file with a lexically later # name in /etc/sysctl.d/ and put new settings there. # # For more information, see sysctl.conf(5) and sysctl.d(5).
# sysctl -w net.ipv6.conf.eth0.disable_ipv6=1 >> /etc/sysctl.conf
If many changes are being made manually editing the file with comments is better.
To manually make the changes edit the
/etc/sysctl.conf. In the example
net.ipv6.conf.eth0.disable_ipv6is being used. If the file is not
/etc/sysctl.confthen run the following to make changes without rebooting.
# sysctl -p /etc/sysctl.d/<filename>
© Lightnetics 2020