To configure a IPFW firewall, first open up rc.conf
with:
sudo ee /etc/rc.conf
Now add the following lines to the end of this file, where the ssh port number is the most important port number to add and should be replaced with the port number chosen whilst configuring the SSH (not doing so will lock out all SSH users from the system. Each port that is required should be listed in the port number area (port 80
might also be useful to add as it is a standard port for http connections, as is port 443
for https that might also be useful to add) and firewall_logdeny
will tell the server to log any connection attept to the /var/log/security
file: