]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - usr.sbin/tcpdrop/tcpdrop.8
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / usr.sbin / tcpdrop / tcpdrop.8
1 .\"     $OpenBSD: tcpdrop.8,v 1.5 2004/05/24 13:57:31 jmc Exp $
2 .\"
3 .\" Copyright (c) 2009 Juli Mallett <jmallett@FreeBSD.org>
4 .\" Copyright (c) 2004 Markus Friedl <markus@openbsd.org>
5 .\"
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.
9 .\"
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.
17 .\"
18 .\" $FreeBSD$
19 .\"
20 .Dd March 24, 2009
21 .Dt TCPDROP 8
22 .Os
23 .Sh NAME
24 .Nm tcpdrop
25 .Nd drop TCP connections
26 .Sh SYNOPSIS
27 .Nm tcpdrop
28 .Ar local-address
29 .Ar local-port
30 .Ar foreign-address
31 .Ar foreign-port
32 .Nm tcpdrop
33 .Op Fl l
34 .Fl a
35 .Sh DESCRIPTION
36 The
37 .Nm
38 command may be used to drop TCP connections from the command line.
39 .Pp
40 If
41 .Fl a
42 is specified then
43 .Nm
44 will attempt to drop all active connections.
45 The
46 .Fl l
47 flag may be given to list the tcpdrop invocation to drop all active
48 connections one at a time.
49 .Pp
50 If
51 .Fl a
52 is not specified then only the connection between the given local
53 address
54 .Ar local-address ,
55 port
56 .Ar local-port ,
57 and the foreign address
58 .Ar foreign-address ,
59 port
60 .Ar foreign-port ,
61 will be dropped.
62 .Pp
63 Addresses and ports may be specified by name or numeric value.
64 Both IPv4 and IPv6 address formats are supported.
65 .Nm
66 in case of success or failure.
67 .Sh EXIT STATUS
68 .Ex -std
69 .Sh EXAMPLES
70 If a connection to
71 .Xr httpd 8
72 is causing congestion on a network link, one can drop the TCP session
73 in charge:
74 .Bd -literal -offset indent
75 # sockstat -c | grep httpd
76 www      httpd      16525 3  tcp4 \e
77         192.168.5.41:80      192.168.5.1:26747
78 .Ed
79 .Pp
80 The following command will drop the connection:
81 .Bd -literal -offset indent
82 # tcpdrop 192.168.5.41 80 192.168.5.1 26747
83 .Ed
84 .Pp
85 The following command will drop all connections but those to or from
86 port 22, the port used by
87 .Xr sshd 8 :
88 .Bd -literal -offset indent
89 # tcpdrop -l -a | grep -vw 22 | sh
90 .Ed
91 .Sh SEE ALSO
92 .Xr netstat 1 ,
93 .Xr sockstat 1
94 .Sh AUTHORS
95 .An Markus Friedl Aq markus@openbsd.org
96 .An Juli Mallett Aq jmallett@FreeBSD.org