RHEL: Displaying/setting kernel parameters - ’sysctl’

RHEL: Displaying/setting kernel parameters - 'sysctl'

# Tested on RHEL 6 & 7

# Setting kernel parameters is a fairly straightforward task. If we check the file
# /etc/sysctl.conf, we will see several attributes with their appropriate values, these are
# the values applied at startup. This file can be edited directly with a text editor, then
# the values reloaded by executing 'sysctl -p'.
# On RHEL 7, default settings are in /usr/lib/sysctl.d/00-system.conf. These default
# settings may be overridden by entering new settings in /etc/sysctl.conf or in an
# /etc/sysctl.d/<name>.conf file.

# These values can also be changed at runtime by modifying the values under /proc/sys.
# For instance, attribute named net.ipv4.ip_forward can be viewed or modified as
# /proc/sys/net/ipv4/ip_forward.

# To view the running value, run:

cat /proc/sys/net/ipv4/ip_forward

# To change the running value, run:

echo 1 > /proc/sys/net/ipv4/ip_forward

# The kernel attributes and values available to change can be found by either browsing the
# /proc/sys folders, or by running 'sysctl -a':

/sbin/sysctl -a | grep net.ipv4.ip_forward

# Lastly, values can be hot modified by running 'sysctl -w' command:

/sbin/sysctl -w

# To fix this change, insert a new line with the parameter in file /etc/sysctl.conf.

# Load in settings from the file specified or /etc/sysctl.conf if none given:

/sbin/sysctl -p [/etc/sysctl.conf]
0 (0)
Article Rating (No Votes)
Rate this article
There are no attachments for this article.
There are no comments for this article. Be the first to post a comment.
Full Name
Email Address
Security Code Security Code
Related Articles RSS Feed
RHEL: Crash kernel dumps configuration and analysis on RHEL 5
Viewed 1628 times since Sat, Jun 2, 2018
12 Tcpdump Commands – A Network Sniffer Tool
Viewed 967 times since Fri, Jul 27, 2018
Check Detailed CPU Information In Linux With CoreFreq [Advanced]
Viewed 929 times since Thu, Apr 18, 2019
Jak wygenerować silne hasła jednorazowe w Linuksie?
Viewed 1162 times since Thu, May 24, 2018
12 Linux Rsync Options in Linux Explained
Viewed 1120 times since Wed, Oct 31, 2018
Using stunnel to Encrypt Database Connections
Viewed 1539 times since Fri, Sep 28, 2018
Linux PAM configuration that allows or deny login via the sshd server
Viewed 679 times since Wed, Oct 3, 2018
How to create stunnel with systemd? stunnel
Viewed 1714 times since Thu, Jan 16, 2020
logrotate Understanding logrotate utility
Viewed 601 times since Sun, Jan 12, 2020
Tunnel SSH Connections Over SSL Using ‘Stunnel’ On Debian 7 / Ubuntu 13.10
Viewed 1025 times since Fri, Sep 28, 2018