BLACKHOLE(4)
πΈ NAME πΈ
okay so this is blackhole(4) from the Kernel Interfaces Manual, and it's literally about how to quietly drop refused SCTP, TCP, or UDP packets. no cap, that's the whole vibe: ghost the packets instead of replying π
β¨ SYNOPSIS β¨
here are the exact little sysctl spells, character for character β copy them like the iconic commands they are:
sysctl net.inet.sctp.blackhole[={0 | 1 | 2}]
sysctl net.inet.tcp.blackhole[={0 | 1 | 2 | 3}]
sysctl net.inet.tcp.blackhole_local[={0 | 1}]
sysctl net.inet.udp.blackhole[={0 | 1}]
sysctl net.inet.udp.blackhole_local[={0 | 1}]
π¦ DESCRIPTION π¦
so the blackhole sysctl(8) MIB is the main character here. it controls system behaviour when connection requests show up on SCTP, TCP, or UDP ports where there is no socket listening, or when unexpected packets are received on listening sockets.
and why would you want that? because the blackhole behaviour is useful to slow down an attacker who is port-scanning a system in an attempt to detect vulnerable services. it might also slow down an attempted denial of service attack. lowkey iconic defensive energy π‘οΈβ¨
the blackhole behaviour is disabled by default. if enabled, the locally originated packets would still be responded to, unless also net.inet.tcp.blackhole_local (for TCP) and/or net.inet.udp.blackhole_local (for UDP) are enforced. that _local part is the plot twist, iykyk π
π SCTP π
setting the SCTP blackhole MIB to a numeric value of one will prevent sending an ABORT packet in response to an incoming INIT. a MIB value of two will do the same, but will also prevent sending an ABORT packet when unexpected packets are received. it's giving βwe don't do replies hereβ π«Ά
π TCP π
normal behaviour, when a TCP SYN segment is received on a port where there is no socket accepting connections, is for the system to return a RST segment, and drop the incoming SYN segment. the connecting system will see this as a βConnection refusedβ. very βthe door is closed, here's a receiptβ energy π
by setting the TCP blackhole MIB to a numeric value of one, the incoming SYN segment is merely dropped, and no RST is sent, making the system appear as a blackhole. by setting the MIB value to two, any segment arriving on a closed port is dropped without returning a RST. setting the MIB value to three, any segment arriving on a closed port or an unexpected segment on a listening port is dropped without sending a RST in reply. this provides some degree of protection against stealth port scans. periodt π₯
π UDP π
enabling blackhole behaviour turns off the sending of an ICMP port unreachable message in response to a UDP datagram which arrives on a port where there is no socket listening. it must be noted that this behaviour will prevent remote systems from running traceroute(8) to a system. so yeah, traceroute girlies, this one will absolutely affect you π
β οΈ WARNING β οΈ
the SCTP, TCP, and UDP blackhole features should not be regarded as a replacement for firewall solutions. better security would consist of theblackholesysctl(8)MIB used in conjunction with one of the available firewall packages.
this mechanism is not a substitute for securing a system. it should be used together with other security mechanisms.
like bestie, this is a cute extra layer, not the whole entire security plan. don't let it be the only thing standing between you and chaos π
π SEE ALSO π
π HISTORY π
the TCP and UDP blackhole MIBs first appeared in FreeBSD 4.0.
the SCTP blackhole MIB first appeared in FreeBSD 9.1.
π AUTHORS π
Geoffrey M. Rehmet β shoutout to the author, absolute legend π
π source/version: Debian β date: September 24, 2025 β and that's the whole cute little blackhole(4) lore bestie, mwah π«Άβ¨
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms