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
Linux – How to check the exit status of several piped commands
Viewed 2756 times since Wed, Jul 25, 2018
How To Ping Specific Port Number
Viewed 3507 times since Mon, Jun 1, 2020
HP-UX - Stunnel Configuration
Viewed 2196 times since Fri, Sep 28, 2018
Top 10 darmowych i publicznych serwerów DNS
Viewed 2096 times since Tue, May 22, 2018
Securing /tmp and shm partitions
Viewed 2958 times since Fri, May 15, 2020
How to do a Filesystem Resize (ext3/ext4) on Redhat running on VMware
Viewed 10768 times since Wed, Jul 25, 2018
Check a Website Availability from the Linux Command Line
Viewed 6223 times since Mon, Feb 18, 2019
HowTo: The Ultimate Logrotate Command Tutorial with 10 Examples
Viewed 4666 times since Fri, Nov 30, 2018
Viewed 16703 times since Sat, Jun 2, 2018
How to disable SSH cipher/ MAC algorithms for Linux and Unix
Viewed 43858 times since Fri, Aug 21, 2020