diff options
Diffstat (limited to 'usr.sbin/tcpdrop/tcpdrop.8')
-rw-r--r-- | usr.sbin/tcpdrop/tcpdrop.8 | 58 |
1 files changed, 45 insertions, 13 deletions
diff --git a/usr.sbin/tcpdrop/tcpdrop.8 b/usr.sbin/tcpdrop/tcpdrop.8 index 5fd3a43..b846257 100644 --- a/usr.sbin/tcpdrop/tcpdrop.8 +++ b/usr.sbin/tcpdrop/tcpdrop.8 @@ -1,5 +1,6 @@ .\" $OpenBSD: tcpdrop.8,v 1.5 2004/05/24 13:57:31 jmc Exp $ .\" +.\" Copyright (c) 2009 Juli Mallett <jmallett@FreeBSD.org> .\" Copyright (c) 2004 Markus Friedl <markus@openbsd.org> .\" .\" Permission to use, copy, modify, and distribute this software for any @@ -16,35 +17,58 @@ .\" .\" $FreeBSD$ .\" -.Dd March 21, 2004 +.Dd March 24, 2009 .Dt TCPDROP 8 .Os .Sh NAME .Nm tcpdrop -.Nd drop a TCP connection +.Nd drop TCP connections .Sh SYNOPSIS .Nm tcpdrop -.Ar laddr -.Ar lport -.Ar faddr -.Ar fport +.Ar local-address +.Ar local-port +.Ar foreign-address +.Ar foreign-port +.Nm tcpdrop +.Op Fl l +.Fl a .Sh DESCRIPTION The .Nm -command drops the TCP connection specified by the local address -.Ar laddr , +command may be used to drop TCP connections from the command line. +.Pp +If +.Fl a +is specified then +.Nm +will attempt to drop all active connections. +The +.Fl l +flag may be given to list the tcpdrop invocation to drop all active +connections one at a time. +.Pp +If +.Fl a +is not specified then only the connection between the given local +address +.Ar local-address , port -.Ar lport +.Ar local-port , and the foreign address -.Ar faddr , +.Ar foreign-address , port -.Ar fport . -Addresses and ports can be specified by name or numeric value. +.Ar foreign-port , +will be dropped. +.Pp +Addresses and ports may be specified by name or numeric value. +Both IPv4 and IPv6 address formats are supported. +.Nm +in case of success or failure. .Sh EXIT STATUS .Ex -std .Sh EXAMPLES If a connection to -.Xr httpd 8 Pq Pa ports/www/apache2 +.Xr httpd 8 is causing congestion on a network link, one can drop the TCP session in charge: .Bd -literal -offset indent @@ -57,8 +81,16 @@ The following command will drop the connection: .Bd -literal -offset indent # tcpdrop 192.168.5.41 80 192.168.5.1 26747 .Ed +.Pp +The following command will drop all connections but those to or from +port 22, the port used by +.Xr sshd 8 : +.Bd -literal -offset indent +# tcpdrop -l -a | grep -vw 22 | sh +.Ed .Sh SEE ALSO .Xr netstat 1 , .Xr sockstat 1 .Sh AUTHORS .An Markus Friedl Aq markus@openbsd.org +.An Juli Mallett Aq jmallett@FreeBSD.org |