A Linux systems administrator is configuring a server with two network interfaces, ens192 (public) and ens224 (private), to act as a router for a private network. The administrator has already configured firewall rules to allow traffic, but client devices on the private network still cannot access the internet. Which of the following commands will enable the necessary kernel parameter to allow packets to be forwarded between the two interfaces for the current session?
The correct command is sysctl -w net.ipv4.ip_forward=1. The net.ipv4.ip_forward parameter in the Linux kernel controls whether IP forwarding is enabled or disabled. A value of '1' enables it, allowing the system to route packets between interfaces. The sysctl -w command writes the value to the parameter, applying it immediately for the current session. Setting this value to '0' would explicitly disable forwarding. The firewall-cmd --add-forward command is not a standard command for enabling kernel forwarding; firewall rules depend on this kernel setting being enabled first. The file /proc/sys/net/ipv4/ip_masquerade does not exist; masquerading is a form of NAT configured through firewall utilities like iptables or firewalld, not directly via a procfs file with that name.
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 IP forwarding in Linux?
Open an interactive chat with Bash
Why is `sysctl -w net.ipv4.ip_forward=1` only valid for the current session?
Open an interactive chat with Bash
How is NAT different from IP forwarding?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Security
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access