I always wondered why there is no standard unix tool to accomplish this.
Also useful would be a tool to close a TCP connection, regardless of the processes that have handles to it.
Also useful would be a tool to close a TCP connection, regardless of the processes that have handles to it.
If a connection to httpd(8) is causing congestion on a network link, one
can drop the TCP session in charge:
# sockstat -c | grep httpd
www httpd 16525 3 tcp4 \
192.168.5.41:80 192.168.5.1:26747
The following command will drop the connection:
# tcpdrop 192.168.5.41 80 192.168.5.1 26747[EDIT]
These tools are a reasonable starting point.
http://linuxpoison.blogspot.co.uk/2008/10/tools-for-creating...
sudo tcpkill -9 -i eth0 host 1.2.3.4 and port 80
It is part of dsniff.http://killcx.sourceforge.net/
In particular, it sends a spoofed SYN packet to induce an ACK packet containing the sequence numbers necessary to send the RST. That means it doesn't rely on there being traffic already.