LFCS 1.1: Kernel parameters
Changing kernel parameters now and for good, a per-interface IPv6 setting, a boot parameter, and module options.
Before you start
The lab turns IPv4 forwarding off and makes sure vm.swappiness isn't 10.
It adds two linked network interfaces, lab0 and lab1, which come back at
every boot; NetworkManager and networkd leave them alone. The dummy module
is unloaded. Reboot when a task says so; the check looks at the running
system.
Tasks
- Turn on IPv4 forwarding until the next reboot only. Check it yourself:
sysctl net.ipv4.ip_forwardshows1now and0after a reboot. Do this one before task 2. - Make IPv4 forwarding permanent, and set
vm.swappinessto10, in a file named/etc/sysctl.d/90-lab.conf, without rebooting. - Disable IPv6 on interface
lab0only, persistently. After a reboot,lab0has no IPv6 addresses whilelab1and the other interfaces keep theirs. - Add the boot parameter
audit=1to every installed kernel, then reboot. - Make the
dummymodule load at every boot with two devices, then reboot.ip -br link | grep -c dummyshould print2.
Hints
sysctl -w,/proc/sys.- A
.conffile in/etc/sysctl.d/, thensysctl --system. - Per-interface keys look like
net.ipv6.conf.NAME.disable_ipv6. grubbyon RHEL relatives;/etc/default/grubandupdate-grubon Ubuntu./proc/cmdlineafter the reboot.modinfo -p dummy,/etc/modprobe.d/,/etc/modules-load.d/. Files in everymodprobe.ddirectory are read in name order and the last setting wins;modprobe --show-depends dummyshows what modprobe will pass.