diff options
author | mbr <mbr@FreeBSD.org> | 2003-07-27 20:34:30 +0000 |
---|---|---|
committer | mbr <mbr@FreeBSD.org> | 2003-07-27 20:34:30 +0000 |
commit | 7223dbc5856e1015f30406abb36853e9d6d9d1ab (patch) | |
tree | 8264e0bb7393540dc3f482ed3b5e414062cdf39f /etc | |
parent | e457974b5d32523a8e299714c5490b150f1aa505 (diff) | |
download | FreeBSD-src-7223dbc5856e1015f30406abb36853e9d6d9d1ab.zip FreeBSD-src-7223dbc5856e1015f30406abb36853e9d6d9d1ab.tar.gz |
Add -dynamic to natd if dhcp is used for the natd interface.
Kill natd in stop().
Reviewed by: mtm
Diffstat (limited to 'etc')
-rw-r--r-- | etc/rc.d/ipfw | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/etc/rc.d/ipfw b/etc/rc.d/ipfw index 531063f..e434123 100644 --- a/etc/rc.d/ipfw +++ b/etc/rc.d/ipfw @@ -9,6 +9,7 @@ # KEYWORD: FreeBSD . /etc/rc.subr +. /etc/network.subr name="ipfw" rcvar="firewall_enable" @@ -40,6 +41,16 @@ ipfw_start() # Network Address Translation daemon # if checkyesno natd_enable; then + dhcp_list="`list_net_interfaces dhcp`" + for ifn in ${dhcp_list}; do + case ${natd_interface} in + ${ifn}) + natd_flags="$natd_flags -dynamic" + ;; + *) + ;; + esac + done if [ -n "${natd_interface}" ]; then if echo ${natd_interface} | \ grep -q -E '^[0-9]+(\.[0-9]+){0,3}$'; then @@ -75,6 +86,8 @@ ipfw_stop() # Disable the firewall # ${SYSCTL_W} net.inet.ip.fw.enable=0 + killall natd; + sleep 2; } load_rc_config $name |