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
ubuntu How to Reset Forgotten Passwords in Ubuntu 16.04
Viewed 2546 times since Tue, Dec 8, 2020
stunnel Securing telnet connections with stunnel
Viewed 1237 times since Sun, Dec 6, 2020
How to use yum-cron to automatically update RHEL/CentOS Linux
Viewed 2425 times since Wed, Oct 17, 2018
RHEL: Allowing users to ’su’ to "root" / Allowing ’root’ to login directly to the system using ’ssh’
Viewed 2503 times since Sat, Jun 2, 2018
SSL HowTo: Decode CSR
Viewed 4457 times since Mon, Feb 18, 2019
A Quick and Practical Reference for tcpdump
Viewed 12018 times since Fri, Jul 27, 2018
8 Vim Tips And Tricks That Will Make You A Pro User
Viewed 2698 times since Fri, Apr 19, 2019
ZPOOL: Remove an existing zpool
Viewed 1940 times since Sun, Jun 3, 2018
Red Hat 8 How to Set Up Automatic Updates for CentOS 8
Viewed 3282 times since Fri, Sep 25, 2020
How to encrypt a partition with DM-Crypt LUKS on Linux
Viewed 7839 times since Fri, Jul 13, 2018