- Lab
- A Cloud Guru
Modifying Kernel Parameters
The Linux kernel provides a wide array of parameters that can alter how the system behaves. In this lab, you will be tasked with modifying specific parameters for the current session and ensuring that these changes will persist through a reboot.
Path Info
Table of Contents
-
Challenge
Modify the Swappiness Parameter to Equal 10 for the Current Session
Use
sysctl
to change the swappiness value to 10:sysctl -w vm.swappiness=10
-
Challenge
Ensure That the Changes Made to the Swappiness Parameter Will Persist through a Reboot
Create a file in
/etc/sysctl.d/
called60-swap.conf
with the following contents:vm.swappiness = 10
This can be done with a text editor or through the command line:
echo "vm.swappiness = 10" > /etc/sysctl.d/60-swap.conf
-
Challenge
Disable icmp_echo_ignore_all and Enable icmp_echo_ignore_broadcast for the Current Session
Disable
icmp_echo_ignore_all
using thesysctl
command:sysctl -w net.ipv4.icmp_echo_ignore_all=0
Enable
icmp_echo_ignore_broadcast
using thesysctl
command:sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1
-
Challenge
Ensure That the Changes Made to icmp_echo_ignore_all and icmp_echo_ignore_broadcast Persist through a Reboot
Create a file in
/etc/sysctl.d/
called60-icmp.conf
with the following system variables:icmp_echo_ignore_all = 0 icmp_echo_ignore_broadcasts = 1
This can be done with a text editor or from the command line using the
echo
command:echo -e 'icmp_echo_ignore_all = 0\nicmp_echo_ignore_broadcasts = 1' > /etc/sysctl.d/60-icmp.conf
-
Challenge
Enable ip_forward for the Current Session
Enable
ip_forward
using thesysctl
command:sysctl -w net.ipv4.ip_forward=1
-
Challenge
Ensure That the Changes Made to ip_forward will Persist through a Reboot
Create a file in
/etc/sysctl.d/
called60-ip.conf
with the following text:net.ipv4.ip_forward = 1
This can be done with a text editor or from the command line:
echo "net.ipv4.ip_forward = 1" > /etc/sysctl.d/60-ip.conf
What's a lab?
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.