Prepare FreeBSD
Enable IP Forwarding in the Kernel
If you have not already done so, enable IP forwarding in the kernel:
# sysctl net.inet.ip.forwarding=1 # sysctl net.inet.ip.fastforwarding=1 # sysctl net.inet6.ip6.forwarding=1
Make sure that the following lines exist in /etc/sysctl.conf so that the next time you reboot, IP forwarding is enabled by default:
# /etc/sysctl.conf net.inet.ip.forwarding=1 net.inet.ip.fastforwarding=1 net.inet6.ip6.forwarding=1
Enable HTTP Accept Filter
Next, make sure that the HTTP Accept filter is loaded into the kernel. You can check this by running the following command:
# kldstat 2 1 0xc0b12000 2464 accf_http.ko
If the filter is not loaded, edit /boot/loader.conf and add the following line so that when you reboot, the HTTP Accept filter kernel module is loaded.
# /boot/loader.conf accf_http_load="YES"
Last of all, to load the module immediately, run the following command:
# kldload accf_http
System V Shared Memory and Semaphore Parameters
Modify System V shared memory and semaphore parameters
# sysctl kern.ipc.shmall=32768 # sysctl kern.ipc.shmmax=134217728 # sysctl kern.ipc.semmap=256
Once again, make these changes permanent by adding the following to /etc/sysctl.conf
# /etc/sysctl.conf kern.ipc.shmall=32768 kern.ipc.shmmax=134217728 kern.ipc.semmap=256 net.inet.ip.forwarding=1 net.inet.ip.fastforwarding=1 net.inet6.ip6.forwarding=1
System V "Read-Only" Semaphore Parameters
Modify the System V "Read-Only" Semaphore Parameters by adding the following to /boot/loader.conf
NOTE: You must reboot for the new values of these parameters to take effect
# /boot/loader.conf kern.ipc.semmni=256 kern.ipc.semmns=512 kern.ipc.semmnu=256 accf_http_load="YES"

Author: