Linux – How to kill a TCP connection using tcpkill utility

linuxnetstattcp

I'm trying to kill an ESTABLISHED TCP connection using tcpkill. The connection is an open HTTPS connection. It appears on netstat as:

tcp        0      0 X.X.X.X:55601         X.X.X.X:https    ESTABLISHED

So, as per the man page, I enter:

$ tcpkill -i eth1 -9 port 443

The tcpkill utility outputs:

tcpkill: listening on eth1 [port 443]

…and then just hangs. After waiting for about 15 minutes, I'm not sure what's going on here.

Am I doing something wrong?

Best Answer

For tcpkill to work (i.e., craft a reset packet that has the correct sequence number and source port), there must be traffic. If nothing more is printed then there is no traffic. To verify you could run tcpdump -i eth1 port 443.