BLACKHOLE(4)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

🌸 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 the blackhole sysctl(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