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.
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- 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
- 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
- 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
- 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 = 0nicmp_echo_ignore_broadcasts = 1' > /etc/sysctl.d/60-icmp.conf
- Enable ip_forward for the Current Session
Enable
ip_forward
using thesysctl
command:sysctl -w net.ipv4.ip_forward=1
- 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