Information
net.ipv4.icmp_ignore_bogus_error_responses controls if the kernel logs bogus responses (RFC-1122 non-compliant) from broadcast reframes.
More information about the kernel parameter configuration files, their location, and load preference is available in the "Configure Network Kernel Parameters" section overview.
Some routers (and some attackers) will send responses that violate RFC-1122 and attempt to fill up a log file system with many useless error messages.
Solution
- Run the following command to comment out net.ipv4.icmp_ignore_bogus_error_responses lines returned by the audit procedure that are not net.ipv4.icmp_ignore_bogus_error_responses = 1 :
# sed -ri '/^\s*net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*0/s/^/#/g' \
"path/to/file/in/audit/filename"
Example:
# sed -ri '/^\s*net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*0/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.icmp_ignore_bogus_error_responses = 1
Example:
# [ ! -d "/etc/sysctl.d/" ] && mkdir -p /etc/sysctl.d/
# printf '%s\n' "" "net.ipv4.icmp_ignore_bogus_error_responses = 1" >> /etc/sysctl.d/60-ipv4_sysctl.conf
- Run the following command to load all sysctl configuration files:
# sysctl --system