Most of the modern versions of FreeBSD have IPsec support in their base source. So you
will need to include the
IPSEC option in your kernel config
and, after kernel rebuild and reinstall, configure IPsec connections using setkey(8) command.
A comprehensive guide on running IPsec on FreeBSD is provided in FreeBSD Handbook.