How to kill a TCP connection using netstat

Home » Questions» Linux


Subscribe to mail newsletter

Linux: How to kill a TCP connection using netstat?

You cannot kill a TCP connection using netstat utility. netstat is use for

  • Display network connections
  • Routing tables
  • Interface statistics
  • Masquerade connections
  • Multicast memberships
  • And much more

However Linux support two other commands or utility that can be used to kill a TCP connection.

tcpkill command

Use tcpkill command to kill specified in-progress TCP connections. It is useful for libnids-based applications which require a full TCP 3-whs for TCB creation.


tcpkill -i eth0 { expression }


(a) Kill all outgoing ftp (port 21) connection:

tcpkill -i eth0 port 21

(b) Kill all all packets arriving at or departing from host (

tcpkill host


tcpkill host

(c) To kill all IP packets between and any host except, type the following:

tcpkill ip host and not

Since tcpkill expressions are based upon tcpdump command's filter expression, it is recommended that you read options with expression and examples.

cutter command

Cutter is an open source program that allows Linux firewall administrators to abort TCP/IP connections routed over Linux based firewall. It works on Linux router only. We have already covered examples of cutter here.

Related articles

Tips & Tricks | Email