xref: /dflybsd-src/usr.sbin/tcpdrop/tcpdrop.8 (revision a811e7b9ed0bfe91a136939d242c79f815e108df)
1da0f7859SSepherosa Ziehau.\"	$OpenBSD: tcpdrop.8,v 1.5 2004/05/24 13:57:31 jmc Exp $
2da0f7859SSepherosa Ziehau.\"
3da0f7859SSepherosa Ziehau.\" Copyright (c) 2009 Juli Mallett <jmallett@FreeBSD.org>
4da0f7859SSepherosa Ziehau.\" Copyright (c) 2004 Markus Friedl <markus@openbsd.org>
5da0f7859SSepherosa Ziehau.\"
6da0f7859SSepherosa Ziehau.\" Permission to use, copy, modify, and distribute this software for any
7da0f7859SSepherosa Ziehau.\" purpose with or without fee is hereby granted, provided that the above
8da0f7859SSepherosa Ziehau.\" copyright notice and this permission notice appear in all copies.
9da0f7859SSepherosa Ziehau.\"
10da0f7859SSepherosa Ziehau.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11da0f7859SSepherosa Ziehau.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12da0f7859SSepherosa Ziehau.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13da0f7859SSepherosa Ziehau.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14da0f7859SSepherosa Ziehau.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15da0f7859SSepherosa Ziehau.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16da0f7859SSepherosa Ziehau.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17da0f7859SSepherosa Ziehau.\"
18da0f7859SSepherosa Ziehau.Dd July 26, 2015
19da0f7859SSepherosa Ziehau.Dt TCPDROP 8
20da0f7859SSepherosa Ziehau.Os
21da0f7859SSepherosa Ziehau.Sh NAME
22da0f7859SSepherosa Ziehau.Nm tcpdrop
23da0f7859SSepherosa Ziehau.Nd drop TCP connections
24da0f7859SSepherosa Ziehau.Sh SYNOPSIS
25*a811e7b9SSascha Wildner.Nm
26da0f7859SSepherosa Ziehau.Ar local-address
27da0f7859SSepherosa Ziehau.Ar local-port
28da0f7859SSepherosa Ziehau.Ar foreign-address
29da0f7859SSepherosa Ziehau.Ar foreign-port
30*a811e7b9SSascha Wildner.Nm
31da0f7859SSepherosa Ziehau.Op Fl l
32da0f7859SSepherosa Ziehau.Fl a
33da0f7859SSepherosa Ziehau.Sh DESCRIPTION
34da0f7859SSepherosa ZiehauThe
35da0f7859SSepherosa Ziehau.Nm
36da0f7859SSepherosa Ziehaucommand may be used to drop TCP connections from the command line.
37da0f7859SSepherosa Ziehau.Pp
38da0f7859SSepherosa ZiehauIf
39da0f7859SSepherosa Ziehau.Fl a
40da0f7859SSepherosa Ziehauis specified then
41da0f7859SSepherosa Ziehau.Nm
42da0f7859SSepherosa Ziehauwill attempt to drop all active connections.
43da0f7859SSepherosa ZiehauThe
44da0f7859SSepherosa Ziehau.Fl l
45da0f7859SSepherosa Ziehauflag may be given to list the tcpdrop invocation to drop all active
46da0f7859SSepherosa Ziehauconnections one at a time.
47da0f7859SSepherosa Ziehau.Pp
48da0f7859SSepherosa ZiehauIf
49da0f7859SSepherosa Ziehau.Fl a
50da0f7859SSepherosa Ziehauis not specified then only the connection between the given local
51da0f7859SSepherosa Ziehauaddress
52da0f7859SSepherosa Ziehau.Ar local-address ,
53da0f7859SSepherosa Ziehauport
54da0f7859SSepherosa Ziehau.Ar local-port ,
55da0f7859SSepherosa Ziehauand the foreign address
56da0f7859SSepherosa Ziehau.Ar foreign-address ,
57da0f7859SSepherosa Ziehauport
58da0f7859SSepherosa Ziehau.Ar foreign-port ,
59da0f7859SSepherosa Ziehauwill be dropped.
60da0f7859SSepherosa Ziehau.Pp
61da0f7859SSepherosa ZiehauAddresses and ports may be specified by name or numeric value.
62da0f7859SSepherosa ZiehauBoth IPv4 and IPv6 address formats are supported.
63da0f7859SSepherosa Ziehau.Pp
64da0f7859SSepherosa ZiehauThe addresses and ports may be separated by periods or colons
65da0f7859SSepherosa Ziehauinstead of spaces.
66da0f7859SSepherosa Ziehau.Sh EXIT STATUS
67da0f7859SSepherosa Ziehau.Ex -std
68da0f7859SSepherosa Ziehau.Sh EXAMPLES
69da0f7859SSepherosa ZiehauIf a connection to
70da0f7859SSepherosa Ziehau.Xr httpd 8
71da0f7859SSepherosa Ziehauis causing congestion on a network link, one can drop the TCP session
72da0f7859SSepherosa Ziehauin charge:
73da0f7859SSepherosa Ziehau.Bd -literal -offset indent
74da0f7859SSepherosa Ziehau# sockstat -c | grep httpd
75da0f7859SSepherosa Ziehauwww      httpd      16525 3  tcp4 \e
76da0f7859SSepherosa Ziehau	192.168.5.41:80      192.168.5.1:26747
77da0f7859SSepherosa Ziehau.Ed
78da0f7859SSepherosa Ziehau.Pp
79da0f7859SSepherosa ZiehauThe following command will drop the connection:
80da0f7859SSepherosa Ziehau.Bd -literal -offset indent
81da0f7859SSepherosa Ziehau# tcpdrop 192.168.5.41 80 192.168.5.1 26747
82da0f7859SSepherosa Ziehau.Ed
83da0f7859SSepherosa Ziehau.Pp
84da0f7859SSepherosa ZiehauThe following command will drop all connections but those to or from
85da0f7859SSepherosa Ziehauport 22, the port used by
86da0f7859SSepherosa Ziehau.Xr sshd 8 :
87da0f7859SSepherosa Ziehau.Bd -literal -offset indent
88da0f7859SSepherosa Ziehau# tcpdrop -l -a | grep -vw 22 | sh
89da0f7859SSepherosa Ziehau.Ed
90da0f7859SSepherosa Ziehau.Sh SEE ALSO
91da0f7859SSepherosa Ziehau.Xr netstat 1 ,
92da0f7859SSepherosa Ziehau.Xr sockstat 1
93da0f7859SSepherosa Ziehau.Sh AUTHORS
94da0f7859SSepherosa Ziehau.An Markus Friedl Aq Mt markus@openbsd.org
95da0f7859SSepherosa Ziehau.An Juli Mallett Aq Mt jmallett@FreeBSD.org
96