CompTIA Linux+ (XK0-005) — Question 47

A systems administrator needs to reconfigure a Linux server to allow persistent IPv4 packet forwarding. Which of the following commands is the correct way to accomplish this task?

Answer options

Correct answer: B

Explanation

The correct command is 'sysctl -w net.ipv4.ip_forward=1' because it modifies the kernel parameter for IPv4 forwarding. While 'echo 1 > /proc/sys/net/ipv4/ipv_forward' can change the setting temporarily, it does not ensure persistence after a reboot. The other options related to firewall and systemctl commands are not valid for enabling IPv4 packet forwarding.