The firewall in the Mac is not enabled by default, unlike the windows counterpart. To enable it:
Go to the System preferences on your mac and click on the Security&Privacy tab.
Then, click the Firewall tab under it. Then, unlock the pane by clicking the lock in the lower-left corner and enter the administrator username and password.
Finally, click the "Turn On Firewall" option or "Start" to enable the firewall on your mac. You can also customize your firewall configuration by clicking the advanced menu.