summaryrefslogtreecommitdiffstats
path: root/etc/rc.d
diff options
context:
space:
mode:
authormbr <mbr@FreeBSD.org>2003-07-27 20:34:30 +0000
committermbr <mbr@FreeBSD.org>2003-07-27 20:34:30 +0000
commit7223dbc5856e1015f30406abb36853e9d6d9d1ab (patch)
tree8264e0bb7393540dc3f482ed3b5e414062cdf39f /etc/rc.d
parente457974b5d32523a8e299714c5490b150f1aa505 (diff)
downloadFreeBSD-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/rc.d')
-rw-r--r--etc/rc.d/ipfw13
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
OpenPOWER on IntegriCloud