I have decided to add a firewall to my computer and have heard of applications such as 'Little Snitch' which help to give me control of inbound and outbound connections on my mac running macOS Sierra. Is there (free) application which would allow me to configure the settings via the command line? The default firewall is also an option, however, I would like to determine the ports myself and preferably the server address that is sending or receiving data from my computer like little snitch allows.
To review what I want, Is there an application which would allow me to block ingoing and outbound connections on my mac through the command-line while allowing me to say what ports and addresses are allowed to communicate on my computer? It would also be good if the application is free.
1 Answer
There is, and it comes with macOS by default.
Little Snitch is an application firewall, that's a whole different story. It blocks applications from accessing the network.
Assuming you want to block ports and servers, just configure pf
from the command line to do what you want. Start by reading through "man pfctl
", or e.g. How to block abusive IP addresses with pf in OpenBSD?
If you want to have a GUI after all, you might want to check out the (free) IceFloor to configure pf
.
To determine the ports yourself and preferably the server address that is sending or receiving data from your computer use the build in command "nettop".
-
Murus Lite is the replacement for IceFloor (which is deprecated) in newer systems Commented Mar 28, 2017 at 10:55
-
Murus is a commercial application. It is not free in all ways (though it's $0 at the free edition) and, having tried it, I can not recommend it for the purpose that the TO is asking for. Since bandwith throttling is not an issue, Icefloor will do just fine on current systems. But feel free to check out Murus if you like. Commented Mar 28, 2017 at 11:11
-
Murus Lite is also free and from the same developer as IceFloor (Hany) Commented Mar 28, 2017 at 11:13
-
It is free in the sense of $0, it is not free in the sense of free software (en.wikipedia.org/wiki/Free_software). Icefloor is free : hanynet.com/icefloor-2.0.2src.zip Commented Mar 28, 2017 at 12:04