A previous post described how to get transparent reverse proxy to work with Pen on Linux. The same functionality is available on FreeBSD.
The FreeBSD host running Pen has IP addresses 192.168.100.11 on em1 and 192.168.101.11 on em2. Like before, the client debian2 has IP address 192.168.100.2 and the server debian3 has IP address 192.168.101.3.
FreeBSD requires far less in the way of special preparations than Linux did in the earlier post; in fact, a single firewall rule is all we need:
ipfw add 10 fwd 127.0.0.1 tcp from any 5001 to any in recv em2
The Pen command is the same whether on Linux or FreeBSD:
sudo ./pen -df -O transparent 192.168.100.11:5001 192.168.101.3
And as before, the client sees a connection from 192.168.100.2 to 192.168.100.11, while the server sees a connection from 192.168.100.2 to 192.168.101.3.