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
net.ipv4.ip_forward=0

# 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
Attachments
There are no attachments for this article.
Comments
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
Using Official Redhat DVD as repository
Viewed 11067 times since Mon, Oct 29, 2018
linux-training.be gives you books for free to study Linux
Viewed 4821 times since Sat, Jun 2, 2018
RHEL: Getting/Setting hardware clock’s time
Viewed 2927 times since Sat, Jun 2, 2018
YUM How to use yum command on CentOS/RHEL
Viewed 6986 times since Thu, Oct 25, 2018
Stunnel Setup
Viewed 17644 times since Fri, Sep 28, 2018
Linux LVM recovery
Viewed 17627 times since Wed, Jan 23, 2019
What UUIDs can do for you
Viewed 1716 times since Tue, Jul 17, 2018
Linux - Cannot login from remote console but can access via ssh
Viewed 4982 times since Fri, Jun 8, 2018
Df command in Linux not updating actual diskspace, wrong data
Viewed 2777 times since Wed, May 30, 2018
Manage SSH Key File With Passphrase
Viewed 2185 times since Tue, Mar 5, 2019