MacOS – Run a program without networking

command linemacosNetwork

Is there a way to run a program on OS X (e.g., from the command line) but without letting it see the network?

I can turn off and disconnect all networking, but then all my other processes will be disconnected, too. I'd like to keep my email, web browser, etc., able to use the network, but this one program isolated.

EDIT: I found this question which is similar, but it uses a static route when the destination host is known. I want to disable networking for all possible hosts, for this one process.

Best Answer

TCPBlock

TCPBlock is a lightweight and fast application firewall ... you can prevent selected applications on your computer from opening connections to the network.

TCPBlock is currently free and can be downloaded here.