ipfw nat on FreeBSD 7

In the kernel configuration add:

options IPFIREWALL # firewall
options IPFIREWALL_VERBOSE # enable logging to syslogd (8)
options IPFIREWALL_DEFAULT_TO_ACCEPT # allow everything by default
options IPDIVERT
options DUMMYNET
options IPFIREWALL_NAT # ipfw kernel nat support
options LIBALIAS

in /etc/make.conf:


Then rebuild your system:

cd /usr/src/; make builworld & & make kernel KERNCONF = YourKern & & make installworld reboot

In the configuration file ipfw:

NatIP = ""
ipfw nat 123 config ip $ (NatIP) log
ipfw add nat 123 10 ip from to any
ipfw add nat 123 20 ip from any to $ (NatIP)

Enjoy the kernel nat

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.