• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

CentOS / RHEL 7 : sysctl kernel parameter doesn’t take effect after reboot

By admin

The Problem

sysctl parameter didn’t take effect after a reboot on RHEL 7 server. Parameter “net.ipv4.conf.all.forwarding” was disable before rebooting the server.

# cat /proc/sys/net/ipv4/conf/all/forwarding
1
# sysctl net.ipv4.conf.all.forwarding=0
net.ipv4.conf.all.forwarding = 0
# cat /proc/sys/net/ipv4/conf/all/forwarding
0
#cat /etc/sysctl.conf|grep net.ipv4.conf.all.forwarding
net.ipv4.conf.all.forwarding = 0
# shutdown -r now
# cat /proc/sys/net/ipv4/conf/all/forwarding            ### Gets enabled after reboot.
1

The Solution

RHEL 7 has a service named “tuned” which helps to create custom profiles and it overrides the “sysctl” values set in the /etc/sysctl.conf file, because “tuned” service will start after “sysctl” service. Use any one of the methods below to define the kernel parameters on RHEL/CentOS 7 server.

1. Check the active tune profile in the affected server.

# tuned-adm active
Current active profile: virtual-guest

2. Navigate to the respective tuned profile directory and verify if the problematic sysctl kernel parameter is defined with any alternate value.

# cd /usr/lib/tuned/virtual-guest
# cat tuned.conf 
#
# tuned configuration
#
[main]
include=throughput-performance
[sysctl]
net.ipv4.conf.all.forwarding = 1

If yes, then there are two option to fix the incorrect sysctl kernel parameter after reboot.

a) Remove the entry in tuned profile, so that “/etc/sysctl.conf” value takes effect.

# cd /usr/lib/tuned/virtual-guest
# cat tuned.conf
#
# tuned configuration
#
[main]
include=throughput-performance
[sysctl]

b) Else, remove the entry in “/etc/sysctl.conf” which will make the tuned value persistent after reboot.

# cat /etc/sysctl.conf | grep net.ipv4.conf.all.forwarding
#

In this case, make sure you have the parameter present in the tuned profile file.

# cd /usr/lib/tuned/virtual-guest
# cat tuned.conf 
#
# tuned configuration
#
[main]
include=throughput-performance
[sysctl]
net.ipv4.conf.all.forwarding = 0

Filed Under: CentOS/RHEL 7, Linux

Some more articles you might also be interested in …

  1. How to Access VNC Server Through A Web Browser in CentOS/RHEL
  2. UNIX / Linux : What Is a Shell? What are different Shells?
  3. How to set “max_report_luns” and “max_luns” on CentOS/RHEL 7 to scan more than 16,383 LUNs
  4. How to Reinstall Corrupted Library with yum
  5. How to Back Up and Restore XFS File Systems (xfsdump / xfsrestore)
  6. How to Use Udev Rules to Create oracleasm Disks in CentOS/RHEL 8
  7. How to create a networking bridge under CentOS/RHEL
  8. Can’t start X11 applications after “su” or “su -” to another user
  9. Managing iSCSI Timeouts Settings in Linux
  10. How to find if NUMA configuration is enabled or disabled?

You May Also Like

Primary Sidebar

Recent Posts

  • What are different Oracle Database Vault Roles
  • Unable to export realm protected table using data pump
  • Beginners Guide to Oracle Database Vault
  • How to Disable IPv6 on Ubuntu 18.04 Bionic Beaver Linux
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary