Enabling FreeBSD firewall
By Rayed
Now with the new FreeBSD releases you don’t have to recompile the kernel to add firewall support (which is easy but take sometime), now firewall module can be loaded as a kernel module, with a simple command like:
# kldload ipfw # (WARNING read on first)
But be careful the default behaviour is to block everything, you need to open the connection you need manually using a command like:
# ipfw -q add allow all from any to any
The first time I tried it I lost my ssh connection.
Fortunately the machine was next to me, so I logged on using the console, and unloaded the module:
# kldunload ipfw
I never worked with kernel modules with FreeBSD, this another useful command, to list the loaded modules you can use:
# kldstat
Note: This feature is little old, since 4.6