Skip to content

Install ocserv on FreeBSD

homepage-banner

Installing ocserv with pkg

pkg install ocserv

Load kernel NAT at startup

Add the following to /boot/loader.conf

ipfw_load="YES"
ipdivert_load="YES"
net.inet.ip.fw.default_to_accept="1"

Enable firewall and NAT support

Add the following to /etc/rc.conf

gateway_enable="YES"
natd_enable="YES"
natd_interface="hn0"
firewall_enable="YES"
firewall_type="OPEN"

Where hn0 is the name of your network interface

Starting ocserv

/usr/local/sbin/ocserv -c /usr/local/etc/ocserv/ocserv.conf -f -d 4

Starting with service ocserv start may result in an error:

exec ocserv-worker failed No such file or directory on freebsd

Starting directly with the command line parameters above should work.

References

  • https://gitlab.com/openconnect/ocserv/-/issues/405
Leave a message