sysctl tunning options, or what could be changed

sysctl is part of all Linux distributions. As its short definition says


sysctl – configure kernel parameters at runtime

using sysctl you can configure various kernel parameters for your Linux system at runtime. There are many sysctl options, and to see them all run

# sysctl -a

Output of above command will be very long and it will contain all available options offered by sysctl.

In my previous post What is the best way to understand Linux and how it works? I wrote about kernel-doc package which contain all documentation ( in my opinion the best one out there ) related to kernel, and necessity to have it installed.

So if you have it installed under /usr/share/doc/kernel-doc-VERSION/Documentation/sysctl you will find more information about sysctl parameters.

There two ways to change sysctl parameters, first one is when you would like to change some value “on-fly”, you can do it by running

  1. sysclt -w value

for example to enable package forwarding on your machine run

# sysctl -w net.ipv4.ip_forward=1

[ man sysclt will show that switch ‘w’ stands for write ]

However these changes are not persistent across reboots, and to make them to survive reboots it is necessary to edit /etc/sysctl.conf on your favorite linux distribution and place desired parameters there.

Format is

net.ipv4.ip_forward = 0

  1. rpm -qf /etc/sysctl.conf will return that sysctl.conf is part of initscripts package and thus you will always have it installed.

What exactly you would like to achieve depends on specific situation, so before changing kernel parameters consider carefully which ones are relevant for your case.

More information

# man sysclt.conf

Happy hacking and tweaking your Linux box