Setup a Firewall on a Mac for inbound and outbound traffic

Setup a Firewall on a Mac for inbound and outbound traffic

What is a firewall?

Whenever a computer or any network device makes a communication with the outside world it needs to open a port. Ports are numbered from 1 to 65,535. For security reasons, it is best to have only the ports open that are needed to do your work. A firewall is a network security device (hardware or software) that monitors traffic to and from your network. It allows or blocks traffic based on a predefined set of rules. Mac, Windows, and Linux computers come with a built-in firewall. Firewalls can be software or hardware, but when we discuss firewalls on de Mac the firewalls are software.

Setup Firewall

First, we set up a firewall to keep unwanted guests out.

  • Open  > System Preferences... > Security & Privacy
  • Click on the Firewall tab
  • Click on the lock icon and log in
  • Select Firewall Options

Which options you should check depend on the circumstances. If you work for a company with high-security standards, you must check Block all incoming connections. Be advised that services like airdrop no longer work. For this reason, I have Block all incoming connections unchecked. All the other options I have checked.

Setup Lulu

The firewall described above is great at keeping the bad guys out. But it is always possible that they somehow manage to enter your system through a malware app. In that case, you want it to be impossible for the malware to communicate with its masters also known as the bad guys. The firewall above can not help you there.

Enter Lulu. Lulu is a free and open-source firewall aimed at blocking outgoing connections.


  • You get a pop-up asking if you want to open this app. Click on Open
  • On the welcome screen Click Next
  • You get another pop-up. Click on Open Security Preferences
  • On the Security and Privacy tab click on the lock icon and authenticate. Then Click on Allow.
  • Next pop-up tells you that LuLu Would like to filter network content. Click on Allow.
  • Finally, a screen asks you to allow programs for Apple and already installed applications. As Lulu is usually the first third-party software that I install on a new Mac I feel safe checking both.
  • Click on next and you are done.

Running Lulu

Lulu will run automatically whenever you log into your Mac unless you configure it otherwise. adAlert.png When Lulu detects an unknown connection it will block it and show you a pop-up window. It is important to look at this pop-up. In the pop-up, Lulu will tell you what program tried to make a connection and to what IP address. If you find it a reasonable connection then click on Allow and you are never bothered about this connection again. If it is a connection you don't want then block it. When you click on the Lulu icon in the status bar then you can always select Rules or Preferences to make changes in the Lulu configuration.