We can test this with natd.
First, put the following in /etc/rc.conf:
```
gateway_enable="YES"
firewall_enable="YES"
firewall_script="/etc/ipfw.conf:
natd_enable="YES"
natd_interface="wam0"
natd_flags=""
```
and the following in /etc/ipfw.conf:
```
ipfw -q add 100 divert natd ip from any to any in via $pif
ipfw -q add 1000 divert natd ip from any to any out via $pif
ipfw -q add 60000 permit ip from any to any
```
You should be able to set these sysctls, such as:
```
sysctl net.inet.divert.recvspace=32768
sysctl net.inet.divert.sendspace=32768