LFCS Certification Kernel Parameter Modification 3 — Questions and Answers
Question 1: What happens if the same sysctl parameter is defined in both /etc/sysctl.conf and a file in /etc/sysctl.d/?
- The file in /etc/sysctl.d/ takes precedence due to alphabetical load order (Correct answer)
- /etc/sysctl.conf always wins regardless of load order
- An error is raised and neither value is applied
- The parameter is set to the average of the two values
Correct answer: The file in /etc/sysctl.d/ takes precedence due to alphabetical load order
Files in /etc/sysctl.d/ are processed after /etc/sysctl.conf in alphabetical order, so later files override earlier ones.
Question 2: Which command reads and displays a single kernel parameter value without changing it?
- sysctl kernel.pid_max (Correct answer)
- sysctl -w kernel.pid_max
- sysctl --get kernel.pid_max
- cat -p kernel.pid_max
Correct answer: sysctl kernel.pid_max
Running 'sysctl <key>' without -w reads and prints the current value of that kernel parameter.
Question 3: A server is experiencing network issues. An admin suspects 'net.core.rmem_max' is too low. Which command shows its current value?
- sysctl net.core.rmem_max (Correct answer)
- cat /etc/sysctl.conf | grep rmem_max
- lsmod | grep rmem_max
- ip link show rmem_max
Correct answer: sysctl net.core.rmem_max
sysctl reads live kernel parameters directly from /proc/sys, giving the current effective value.
Question 4: What is the purpose of the kernel parameter 'net.ipv4.tcp_syncookies'?
- Protects against SYN flood attacks by enabling SYN cookies (Correct answer)
- Enables TCP connection keep-alive messages
- Controls the TCP connection timeout value
- Sets the maximum number of simultaneous TCP connections
Correct answer: Protects against SYN flood attacks by enabling SYN cookies
tcp_syncookies enables SYN cookies as a defense against SYN flood denial-of-service attacks.
Question 5: Which proc path would you write to in order to immediately disable IPv6 on interface eth0?
- /proc/sys/net/ipv6/conf/eth0/disable_ipv6 (Correct answer)
- /proc/sys/net/ipv6/eth0/disabled
- /proc/net/ipv6/conf/eth0/disable
- /sys/class/net/eth0/ipv6/disable
Correct answer: /proc/sys/net/ipv6/conf/eth0/disable_ipv6
Writing 1 to /proc/sys/net/ipv6/conf/eth0/disable_ipv6 immediately disables IPv6 on that interface.
Question 6: How do you list ALL current kernel parameters and their values using sysctl?
- sysctl -a (Correct answer)
- sysctl --list-all
- sysctl -p
- sysctl -r
Correct answer: sysctl -a
The -a flag instructs sysctl to print all currently available kernel parameters and their values.
Question 7: Which kernel parameter should be set to '1' to allow a Linux server to route packets between network interfaces?
- net.ipv4.ip_forward (Correct answer)
- net.core.forwarding
- kernel.ip_routing
- net.ipv4.route.enable
Correct answer: net.ipv4.ip_forward
Setting net.ipv4.ip_forward=1 enables the kernel to forward packets between interfaces, making the host act as a router.
What happens if the same sysctl parameter is defined in both /etc/sysctl.conf and a file in /etc/sysctl.d/?