We can test this with natd.a C program:
First, put the following in /etc/rc.conf:
```
gateway_enable="YES"unsigned long sndbuf = 8192, rcvbuf = 16384;
firewall_enable="YES"setsockopt(s, IPPROTO_DIVERT, IP_DIVSENDBUF, &sndbuf, sizeof(sndbuf));
firewall_script="/etc/ipfw.conf:setsockopt(s, IPPROTO_DIVERT, IP_DIVRECVBUF, &rcvbuf, sizeof(rcvbuf));
natd_enable="YES"
natd_interface="wan0"
natd_flags=""
```
Replace wan0 with your WAN/external interface.
and the following in /etc/ipfw.conf:
```
ipfw -q add 100 divert natd ip from any to any in via wan0
ipfw -q add 1000 divert natd ip from any to any out via wan0
ipfw -q add 60000 permit ip from any to any
```
Replace wan0 with your WAN/external interface.
You should be able to set these sysctls, such as:
```
sysctl net.inet.divert.recvspace=32768
sysctl net.inet.divert.sendspace=32768