1.\" 2.\" blackhole - drop refused TCP or UDP connects 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 13.\" 14.\" $FreeBSD$ 15.Dd August 17, 1999 16.Dt BLACKHOLE 4 17.Os FreeBSD 18.Sh NAME 19.Nm \&blackhole 20.Nd a 21.Xr sysctl 8 22MIB for manipulating behaviour in respect of refused TCP or UDP connection 23attempts. 24.Sh SYNOPSIS 25.Nm \&sysctl net.inet.tcp.blackhole 26.Nm \&sysctl net.inet.udp.blackhole 27.Pp 28.Nm \&sysctl -w net.inet.tcp.blackhole=[0 | 1 | 2] 29.Nm \&sysctl -w net.inet.udp.blackhole=[0 | 1] 30.Sh DESCRIPTION 31The 32.Nm 33.Xr sysctl 8 34MIB is used to control system behaviour when connection requests 35are received on TCP or UDP ports where there is no socket listening. 36.Pp 37Normal behaviour, when a TCP SYN segment is received on a port where 38there is no socket accepting connections, is for the system to return 39a RST segment, and drop the connection. The connecting system will 40see this as a "Connection reset by peer". By turning the TCP black 41hole MIB on to a numeric value of one, the incoming SYN segment 42is merely dropped, and no RST is sent, making the system appear 43as a blackhole. By setting the MIB value to two, any segment arriving 44on a closed port is dropped without returning a RST. This provides 45some degree of protection against stealth port scans. 46.Pp 47In the UDP instance, enabling blackhole behaviour turns off the sending 48of an ICMP port unreachable message in response to a UDP datagram which 49arrives on a port where there is no socket listening. It must be noted 50that this behaviour will prevent remote systems from running 51.Xr traceroute 8 52to your system. 53.Pp 54The blackhole behaviour is useful to slow down anyone who is port scanning 55your system, in order to try and detect vulnerable services on your system. 56It could potentially also slow down someone who is attempting a denial 57of service against your system. 58.Pp 59.Sh WARNING 60The TCP and UDP blackhole features should not be regarded as a replacement 61for 62.Xr ipfw 8 63as a tool for firewalling your system. In order to create a highly 64secure system, you should use 65.Xr ipfw 8 66to protect your system, and not the blackhole feature. 67.Pp 68This mechanism is not a substitute for securing your system, 69but should be used together with other security mechanisms. 70.Pp 71.Sh "SEE ALSO" 72.Xr ipfw 8 73.Xr sysctl 8 74.Xr ip 4 75.Xr tcp 4 76.Xr udp 4 77.Sh AUTHORS 78.An Geoffrey M. Rehmet 79.Sh HISTORY 80The TCP and UDP 81.Nm 82MIBs 83first appeared in 84.Fx 4.0 85