Debian GNU/Linux · Network

Harden ICMP and TCP handling against floods and bogus packets

When it fails: The kernel ICMP and TCP settings leave the system open to simple floods and protocol abuse. Broadcast pings, bogus ICMP errors and SYN floods can be used to exhaust the system or to amplify attacks against others.

CB-DEB-NET-012lowactiveautomatedautomated fixprofile core

Description

These kernel settings make the IPv4 stack resist common abuse:

  • net.ipv4.icmp_echo_ignore_broadcasts = 1: do not answer pings sent to broadcast or multicast addresses;
  • net.ipv4.icmp_ignore_bogus_error_responses = 1: do not log ICMP errors that violate RFC 1122;
  • net.ipv4.tcp_syncookies = 1: answer with SYN cookies when the queue of half-open connections is full;
  • net.ipv4.tcp_rfc1337 = 1: protect sockets in TIME-WAIT state from being reset by stray packets (RFC 1337);
  • net.ipv4.ip_local_port_range = 32768 65535: use the widest range of ephemeral ports, which makes source ports harder to guess.

Debian already ships the first three values. The last two come from ANSSI.

Rationale

Answering broadcast pings turns the host into an amplifier for smurf attacks. Bogus error messages can fill the logs. SYN cookies keep the host reachable during a SYN flood (RFC 4987). RFC 1337 protection and a wide ephemeral port range make connection hijacking and blind spoofing harder.

Impact

None known. The wider port range can collide with a service listening on a port between 61000 and 65535; reserve such ports with net.ipv4.ip_local_reserved_ports.

Setting

Locationsysctl `net.ipv4.icmp_echo_ignore_broadcasts`, `net.ipv4.icmp_ignore_bogus_error_responses`, `net.ipv4.tcp_syncookies`, `net.ipv4.tcp_rfc1337`, `net.ipv4.ip_local_port_range`, persisted in `/etc/sysctl.d/`
Default1, 1, 1, 0, 32768 60999
Recommended1, 1, 1, 1, 32768 65535

Audit

Run sysctl net.ipv4.icmp_echo_ignore_broadcasts net.ipv4.icmp_ignore_bogus_error_responses net.ipv4.tcp_syncookies net.ipv4.tcp_rfc1337 net.ipv4.ip_local_port_range and compare with the recommended values. Check that no sysctl file sets other values.

Automated: every check must pass. Scanners report each check by its id.

echo-ignore-broadcasts

net.ipv4.icmp_echo_ignore_broadcasts.

key: net.ipv4.icmp_echo_ignore_broadcasts
value: 1

ignore-bogus-errors

net.ipv4.icmp_ignore_bogus_error_responses.

key: net.ipv4.icmp_ignore_bogus_error_responses
value: 1

syncookies

net.ipv4.tcp_syncookies.

key: net.ipv4.tcp_syncookies
value: 1

rfc1337

net.ipv4.tcp_rfc1337.

key: net.ipv4.tcp_rfc1337
value: 1

local-port-range

net.ipv4.ip_local_port_range.

key: net.ipv4.ip_local_port_range
value: 32768 65535

Remediation

Add to /etc/sysctl.d/60-cirsec.conf:

net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.icmp_ignore_bogus_error_responses = 1
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_rfc1337 = 1
net.ipv4.ip_local_port_range = 32768 65535

remove other assignments, then run sysctl --system.

Restartnone
Disruptionnone

Rollback

Remove the lines from /etc/sysctl.d/60-cirsec.conf and set the previous values with sysctl -w.

echo-ignore-broadcasts

Generated from check echo-ignore-broadcasts: the engine writes the fix for every output, it sets the expected value and the check runs again after.

ignore-bogus-errors

Generated from check ignore-bogus-errors: the engine writes the fix for every output, it sets the expected value and the check runs again after.

syncookies

Generated from check syncookies: the engine writes the fix for every output, it sets the expected value and the check runs again after.

rfc1337

Generated from check rfc1337: the engine writes the fix for every output, it sets the expected value and the check runs again after.

local-port-range

Generated from check local-port-range: the engine writes the fix for every output, it sets the expected value and the check runs again after.

Each release turns these fixes into remediate.sh and an Ansible role per profile: dry run by default, a fix runs only when its check fails.

References

Mappings

FrameworkIDRelationNote
ANSSI-BP-028 - Recommandations de configuration d'un système GNU/Linux2.0R12partialR12 lists many IPv4 settings; this control covers ICMP and TCP ones.
NIST SP 800-53 Rev. 55.1.1SC-5related

How this control relates to the other framework's: equivalent, stricter, looser, partial or related.

Threats mitigated

People and lifecycle

Authors
Verified2026-10-18 by Sn0wAlice on 12, Proxmox VM 921, Debian 12 genericcloud image, kernel 6.1.0-54-cloud-amd64. Generated check, fix and check again; values kept after reboot; fix idempotent.
Verified2026-10-18 by Sn0wAlice on 13, Proxmox VM 931, Debian 13 genericcloud image, kernel 6.12.113+deb13-cloud-amd64. Generated check, fix and check again; values kept after reboot; fix idempotent.
Introduced inv0.1.0
Created, updated2026-10-18, 2026-10-18
Translationsfr