3.3.1.2 Ensure net.ipv4.conf.all.forwarding is configured

Information

ICMP Redirects are used to send routing information to other hosts. As a host itself does not act as a router (in a host only configuration), there is no need to send redirects.

net.ipv4.conf.all.forwarding controls forwarding of IPv4 packet on all interfaces.

More information about the kernel parameter configuration files, their location, and load preference is available in the "Configure Network Kernel Parameters" section overview.

Note:

- If this system is a router this recommendation is not applicable.
- If net.ipv4.ip_forward=0 is configured, this recommendation may be skipped.

Routing protocol daemons are typically used on routers to exchange network topology information with other routers. If this capability is used when not required, system network information may be unnecessarily transmitted across the network.

Solution

- Run the following command to comment out net.ipv4.conf.all.forwarding lines returned by the audit procedure that are not net.ipv4.conf.all.forwarding=0 :

# sed -ri '^\s*net.ipv4.conf.all.forwarding\s*=\s*1/s/^/#/g' "path/to/file/in/audit/filename"

Example:

# sed -ri '/^\s*net.ipv4.conf.all.forwarding\s*=\s*1/s/^/#/g' /etc/sysctl.d/99-sysctl.conf
- Create or edit a file in the /etc/sysctl.d/ directory ending in .conf and edit or add the following line:

net.ipv4.conf.all.forwarding = 0

Example:

# [ ! -d "/etc/sysctl.d/" ] && mkdir -p /etc/sysctl.d/
# printf '%s\n' "" "net.ipv4.conf.all.forwarding = 0" >> /etc/sysctl.d/60-ipv4_sysctl.conf
- Run the following command to load all sysctl configuration files:

# sysctl --system

Impact:

IP forwarding is required on systems configured to act as a router. If these parameters are disabled, the system will not be able to perform as a router.

Cloud Service Provider (CSP) hosted systems may require forwarding to be enabled. If the system is running on a CSP platform, this requirement should be reviewed before disabling IPv4 forwarding.

See Also

https://workbench.cisecurity.org/benchmarks/25279

Item Details

Category: CONFIGURATION MANAGEMENT

References: 800-53|CM-6b., CCI|CCI-000366, CSCv7|9.2, Rule-ID|SV-250317r1017358_rule, Rule-ID|SV-252662r991589_rule, Rule-ID|SV-257970r1045011_rule, Rule-ID|SV-269249r1050131_rule, Rule-ID|SV-271872r1092328_rule

Plugin: Unix

Control ID: 22398c10a05167bc3135450950328a411f5248591bf9271edc2d578239e309e8