How To Cut Existing Network Connection In Linux?


Today’s applications creates a lot of network connection to the different servers. These connection may legit or unwanted connection. If you are looking a tool that will end the network connection between two host cutter is one of the best solution. Keep in mind that we assume the Linux box sits between hosts or one host in one side.

Install Tcpkill

We will use tcpkill for cutting network connections. Tcpkill tool is provided by dsniff package



List Connections

We will first list all connection with netstat command. We want TCP connections and numbered ip addresses.

Kill Connection

We will kill connection by providing target connection tcpdump style filter. Tcpdump style filter is the syntax used in tcpdump to filter network traffic. In our situation is very easy. We just provide the ip address and host keyword.

  • -i ens3 specifies that we want to use ens3 interfaces for kill operation
  • port 22 is our target port where connections will be killed. We kill ssh server so we will disconnect

Our connection is killed and our ssh session ended 🙂

LEARN MORE  How To Add or Change Default Route or Default Gateway in Ubuntu, Lnux?

You may also like...

Leave a Reply

Your email address will not be published.

Enjoy this blog? Please spread the word :)