Kill TCP connections on a Mac in Terminal
Option 1

You can install tcpkill. It is part of the dsniff package which is in MacPorts. You said you don't want to install other software. Nevertheless MacPorts is really useful if you work from the command line. I suggest you check it out.

Option 2

On StackOverflow there is a related post: Find (and kill) process locking port 3000 on Mac. The suggested solution there is to create a function that kills all connection on a specific port:

function killport() { lsof -i TCP:$1 | awk '/LISTEN/ {print $2}' | xargs kill -9 }


If you change the function by taking away the argument the function should kill all applications that have an open TCP connection.

function killport() { lsof -i TCP | awk '/LISTEN/ {print $2}' | xargs kill -9 }


Disclaimer: I haven't tested this.

Disclaimer 2: It's a brute force method and can have some serious side effects. I would recommend against this approach.