There is a tool http://www.freeipdb.org/
It is designed mainly for ISP's who are allocating a lot of subnets.
I've set it up and it works as advertised - however the setup is
fairly complex. Also, I set it up under Solaris so there may be some
FreeBSD differences. I would strongly advise using FreeBSD 4.11 and
the included Perl 5.0 rather than a newer version of Perl.
The downside is that the developer seems to have lost interest in the
project as there's been little new development on it, and the number of
people who use it is not a lot.
Also, you really should be pretty familiar with subnet mathematics
because this isn't a teaching tool by any means. If that is what you
are looking for let me know as I can refer you to some of that.