Red Hat Certified System Administrator RHCSA · Free Practice Question Medium

Question 41

On ServerB, configure IPv4 packet forwarding to enable the system to forward IPv4 packets between network interfaces. Ensure that this configuration is applied immediately and persists after a system reboot.

  • A

    Pass

  • B

    Fail

Reveal correct answer

Correct answer: A

Explanation

Answer:

To enable IPv4 packet forwarding and make it persistent across reboots, follow these steps:

  1. Check the Current State of IPv4 Packet Forwarding:

    OR

    • Explanation: This command checks if IPv4 packet forwarding is enabled. An output of 0 means it is currently disabled, while 1 means it is enabled. If the output is 0, proceed with the following steps to enable and persist the setting.

  2. Edit the sysctl.conf File to Enable Packet Forwarding:

    • Explanation: The /etc/sysctl.conf file contains kernel parameter settings that apply at boot. Editing this file makes the IPv4 forwarding setting persistent.

  3. Add the IPv4 Forwarding Setting:

    • Press I to enter insert mode, then add the following line:

    • Explanation: Adding net.ipv4.ip_forward=1 enables IPv4 forwarding at the kernel level. The 1 sets it to enabled, while 0 would disable it.

    • Alternative Command:

      • Instead of manually editing, you can append the setting to sysctl.conf with:

  4. Save and Exit the sysctl.conf File:

    • Press Esc to switch to command mode, then type :wq and press Enter to save and exit vim.

  5. Apply the Changes Immediately:

    • Explanation: The -p option reloads settings from /etc/sysctl.conf, applying any changes immediately without needing a reboot.

  6. Verify IPv4 Packet Forwarding:

    OR

    • Explanation: Either command verifies that IPv4 packet forwarding is enabled. The output should show 1, confirming the setting is active.

  7. Confirm Persistence Across Reboots:

    • Reboot the System:

    • Verification After Reboot:

      • After the reboot, check the status of IPv4 packet forwarding again:

        OR

      • Expected Output: The output should show 1, indicating that IPv4 forwarding remains enabled and the setting persisted through the reboot.

Additional Notes:

  • Understanding sysctl and sysctl.conf:

    • sysctl: The command configures kernel parameters at runtime. With -p, it reads settings from /etc/sysctl.conf.

    • /etc/sysctl.conf: This file stores persistent kernel settings. Changes here are applied automatically on reboot.

  • Common Errors and Troubleshooting:

    • Permissions: Ensure you run all commands with root privileges.

    • Verifying After Changes: Always verify the forwarding status after making changes to ensure they’re applied successfully.

Discussion

Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.

You must be logged in to post a comment.

Preparing For

Your Certification?

255+ certifications
Detailed explanations
Free PDF samples

Has All The Questions You Need