Skip to content

Instantly share code, notes, and snippets.

@hassy
Last active January 13, 2020 04:55
Show Gist options
  • Save hassy/d8724debd490b323237a to your computer and use it in GitHub Desktop.
Save hassy/d8724debd490b323237a to your computer and use it in GitHub Desktop.
tcpkill

Problem: I needed to test some code that would auto-reconnect to a remote service, without being able to stop/restart the service.

Solution: tcpkill

For example:

apt-get install dsniff

sudo tcpkill -i eth0 port 27017 # no more outgoing connections to Mongodb

There must be some traffic on the connection for tcpkill to work. You can't kill an idle connection. killcx might be of use in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment