How do I kill a tcp connection?

Solution Verified - Updated -

Issue

  • How can I kill all TCP connections before starting backups?
  • Is there a tool to terminate TCP connections (like tcpdrop on Solaris)?
  • In my HA cluster environment I move a TCP service with the IP it is bound to a different cluster node. The clients utilizing the service have to wait for the tcp connection to time out on their side to reconnect to the relocated service. How can the TCP connection be terminated?
  • Can I kill/reset all TCP connections that are using an IP that is locally assigned on my system?
  • On Solaris I can use the TCP_IOC_ABORT_CONN ioctl, on FreeBSD/OpenBSD the TCPCTL_DROP ioctl with the tcpdrop utility. What can I use on Linux to accomplish the same?
  • We used tcpkill to block host and port for connections but its not fast enough to kill all session. is it possible to do this by configuration firewall or iptables?

Environment

  • Red Hat Enterprise Linux
  • TCP (Transmission Control Protocol) network traffic

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In