How do I permanently change a kernel parameter/tunable on redhat?

  • Refer to the readme important notes first. README.

    Also see:
    sysctl(8) - configure kernel parameters at runtime
    sysctl.conf(5) - sysctl preload/configuration file
    sysctl.d - Configure kernel parameters at boot

    Also see: How do I temporarily change a kernel parameter/tunable on redhat?

    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.conf file.

    The /etc/sysctl.d/99-sysctl.conf is a symbolic link to /etc/sysctl.conf.

    # 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_ipv6 is being used. If the file is not /etc/sysctl.conf then run the following to make changes without rebooting.

    # sysctl -p /etc/sysctl.d/<filename>

Log in to reply

© Lightnetics 2020