A systems administrator has added the line net.ipv4.ip_forward = 1 to the /etc/sysctl.conf file to enable IP forwarding. Which command must be run for this change to take effect immediately without requiring a system reboot?
The correct command is sysctl -p. The sysctl utility lets administrators configure kernel parameters at runtime. Because the parameter was added to /etc/sysctl.conf, it will persist after a reboot, but it is not active until the file is reloaded. Running sysctl -p without any additional arguments reloads /etc/sysctl.conf and applies the new setting to the running kernel right away, avoiding a reboot. Using sysctl -w net.ipv4.ip_forward=1 would also enable forwarding immediately, but it writes the value directly and does not read it from the configuration file, so it is not the correct way to apply the file-based change. systemctl restart systemd-networkd only restarts the network service, and reboot would activate the setting but violates the requirement to avoid restarting the system.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the purpose of the `/etc/sysctl.conf` file?
Open an interactive chat with Bash
What does the `sysctl -p` command do?
Open an interactive chat with Bash
Why is `sysctl -w` not the correct command in this situation?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Services and User Management
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access