IPFW is a firewall written for FreeBSD which has been included in OSX for years. You can easily add and remove rules to alter its behavior, but sometimes you just want to check if it is enable or not.

To check if IPFW is running, open your Terminal and type:

/usr/sbin/sysctl net.inet.ip.fw.enable

Moreover, if you want to turn it on (or off) there are 2 ways.

Firt one is:
sudo /sbin/ipfw enable firewall
# or to turn it off
sudo /sbin/ipfw disable firewall
The second way is:
sudo sysctl -w net.inet.ip.fw.enable=1
# or to turn it off
sudo sysctl -w net.inet.ip.fw.enable=0