No need to do any shell script :
add the following lines in your /etc/rc.conf
(the important line is the third "-dynamic")
natd_enable="YES"# Enable natd (if firewall_enable == YES).
natd_interface="ed1" # Public interface or IPaddress to use.
natd_flags="-dynamic"# Additional fla
> I have a FreeBSD server as a gatewar and firewall for a small LAN. It is
> running NATD for the LAN with non-routable IPs on the secondary adapter,
as
> it is a dual-homed host, it uses DHCP to get an IP from the ISP for the
> primary adapter. This presents a problem occasionally when a new le