LFCS Certification Kernel Parameter Modification 2 — Questions and Answers
Question 1: Which file would you edit to make the kernel parameter 'net.ipv4.ip_forward=1' persist across reboots on a systemd-based system?
- /etc/sysctl.conf (Correct answer)
- /proc/sys/net/ipv4/ip_forward
- /etc/modules-load.d/ip_forward.conf
- /run/sysctl.d/ip_forward.conf
Correct answer: /etc/sysctl.conf
/etc/sysctl.conf is the primary file for persistent kernel parameter settings that survive reboots.
Question 2: What is the effect of running 'sysctl -w vm.swappiness=10'?
- Changes swappiness only for the current session until reboot (Correct answer)
- Permanently sets swappiness to 10 in /etc/sysctl.conf
- Reloads all sysctl parameters from configuration files
- Sets swappiness to 10% of available RAM
Correct answer: Changes swappiness only for the current session until reboot
The -w flag writes the value to the live kernel immediately but does not persist across reboots.
Question 3: Which directory under /proc/sys corresponds to the sysctl key 'kernel.hostname'?
- /proc/sys/kernel/hostname (Correct answer)
- /proc/sys/net/hostname
- /proc/sys/sys/kernel/hostname
- /proc/kernel/hostname
Correct answer: /proc/sys/kernel/hostname
Sysctl keys map to /proc/sys paths by replacing dots with slashes, so kernel.hostname → /proc/sys/kernel/hostname.
Question 4: A sysadmin wants to apply all settings from /etc/sysctl.d/ without rebooting. Which command accomplishes this?
- sysctl --system (Correct answer)
- sysctl -p /etc/sysctl.d/
- sysctl -a --reload
- systemctl restart sysctl
Correct answer: sysctl --system
'sysctl --system' loads settings from all standard sysctl configuration directories including /etc/sysctl.d/.
Question 5: What does the kernel parameter 'kernel.dmesg_restrict=1' control?
- Restricts dmesg output to privileged users only (Correct answer)
- Disables the dmesg ring buffer entirely
- Limits dmesg buffer size to 1 MB
- Prevents writing to the kernel log
Correct answer: Restricts dmesg output to privileged users only
When set to 1, kernel.dmesg_restrict prevents unprivileged users from reading the kernel ring buffer via dmesg.
Question 6: Which sysctl parameter controls the maximum number of open file descriptors system-wide?
- fs.file-max (Correct answer)
- kernel.fd-max
- net.core.somaxconn
- vm.max_map_count
Correct answer: fs.file-max
fs.file-max sets the system-wide maximum number of file handles the kernel will allocate.
Question 7: Drop-in files placed in /etc/sysctl.d/ must have which file extension to be processed by sysctl --system?
- .conf (Correct answer)
- .cfg
- .sysctl
- .ini
Correct answer: .conf
Only files ending in .conf inside /etc/sysctl.d/ are automatically read by 'sysctl --system'.
Which file would you edit to make the kernel parameter 'net.ipv4.ip_forward=1' persist across reboots on a systemd-based system?