1 .\" $OpenBSD: tcpdrop.8,v 1.5 2004/05/24 13:57:31 jmc Exp $
3 .\" Copyright (c) 2009 Juli Mallett <jmallett@FreeBSD.org>
4 .\" Copyright (c) 2004 Markus Friedl <markus@openbsd.org>
6 .\" Permission to use, copy, modify, and distribute this software for any
7 .\" purpose with or without fee is hereby granted, provided that the above
8 .\" copyright notice and this permission notice appear in all copies.
10 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20 .Dd September 15, 2017
25 .Nd drop TCP connections
48 command may be used to drop TCP connections from the command line.
54 will attempt to drop all TCP connections.
60 will attempt to drop all connections using the TCP stack
67 will attempt to drop all TCP connections being in the state
87 will attempt to drop all TCP connections being in the state
89 and using the TCP stack
91 Since TCP connections in the
93 state are not tied to any TCP stack, using the option
95 in combination with the
99 not dropping any TCP connection.
103 flag may be given in addition to the
108 options to list the tcpdrop invocation to drop all corresponding TCP
109 connections one at a time.
116 options are specified then only the connection between the given local
121 and the foreign address
122 .Ar foreign-address ,
127 Addresses and ports may be specified by name or numeric value.
128 Both IPv4 and IPv6 address formats are supported.
130 The addresses and ports may be separated by periods or colons
137 is causing congestion on a network link, one can drop the TCP session
139 .Bd -literal -offset indent
140 # sockstat -c | grep httpd
141 www httpd 16525 3 tcp4 \e
142 192.168.5.41:80 192.168.5.1:26747
145 The following command will drop the connection:
146 .Bd -literal -offset indent
147 # tcpdrop 192.168.5.41 80 192.168.5.1 26747
150 The following command will drop all connections but those to or from
151 port 22, the port used by
153 .Bd -literal -offset indent
154 # tcpdrop -l -a | grep -vw 22 | sh
157 The following command will drop all connections using the TCP stack
159 .Bd -literal -offset indent
163 To drop all TCP connections in the LAST_ACK state use:
164 .Bd -literal -offset indent
165 # tcpdrop -s LAST_ACK
168 To drop all TCP connections using the TCP stack fastack and being in the
170 .Bd -literal -offset indent
171 # tcpdrop -S fastack -s LAST_ACK
179 .An Markus Friedl Aq Mt markus@openbsd.org
180 .An Juli Mallett Aq Mt jmallett@FreeBSD.org