«

»

MacBook Firewall Port Configuration

Like everyone else i trust you run your MacBook, PC or whatever you’re using in the most secure way possible, right  😁 ? One of many aspects are to make sure the local firewall is active and in MacOs that’s controlled via System Preferences -> Security & Privacy -> Firewall.

Via Firewall Options you have more options than just turn the Firewall on and off.

If the Firewall is on and you need to open a specific port on your MacBook, which i had to do the other day when trying to start the Virtual Keyboard via Sumpermicro BMC Intelligent Platform Management Interface (IMPI) Interface, you need to use the package filter (pf) component.

The Virtual Keyboard requires connection on TCP port 623 according to Sumpermicro BMC Intelligent Platform Management Interface (IMPI) User Guide.

I used the following steps to enable Virtual Keyboard access:

  • Stop package filter using command:
    • sudo pfctl -d
  • Added the below line to the end at the package filter configuration file, /etc/pf.conf
    • pass in inet proto tcp from any to any port 623 no state
  • Reload the configuration using the following command:
    • sudo pfctl -f /etc/pf.conf
  • Start package filter using command:
    • sudo pfctl -e

For the moment i’m running macOS Monterey (version 12.3) but package filter management has been the same for quite a few macOS versions.