summaryrefslogtreecommitdiffstats
path: root/etc/rc.network
diff options
context:
space:
mode:
authornectar <nectar@FreeBSD.org>1998-07-08 15:40:53 +0000
committernectar <nectar@FreeBSD.org>1998-07-08 15:40:53 +0000
commit05d7faa963d38e43b842146dbcf1162133e4c1a2 (patch)
tree22371c31cdbf0a4c7544d5194abe74b5b42c7275 /etc/rc.network
parentc8a05e725f167be727e295b86da10cdad25dd5cc (diff)
downloadFreeBSD-src-05d7faa963d38e43b842146dbcf1162133e4c1a2.zip
FreeBSD-src-05d7faa963d38e43b842146dbcf1162133e4c1a2.tar.gz
Allow either an IP address or an interface to be specified in
the rc.conf variable ``natd_interface''. rc.network will determine whether it is an IP address or an interface name, and invoke natd with the -a or -n flag as appropriate. PR: 6947 Reviewed by: jkh@FreeBSD.ORG
Diffstat (limited to 'etc/rc.network')
-rw-r--r--etc/rc.network16
1 files changed, 11 insertions, 5 deletions
diff --git a/etc/rc.network b/etc/rc.network
index 5c362b2..c41d7ac 100644
--- a/etc/rc.network
+++ b/etc/rc.network
@@ -1,6 +1,6 @@
#!/bin/sh -
#
-# $Id: rc.network,v 1.26 1998/05/19 04:36:31 jkh Exp $
+# $Id: rc.network,v 1.27 1998/06/14 16:31:03 steve Exp $
# From: @(#)netstart 5.9 (Berkeley) 3/30/91
# Note that almost all the user-configurable behavior is no longer in
@@ -269,10 +269,16 @@ network_pass3() {
fi
# Network Address Translation daemon
- if [ "X${natd_enable}" = X"YES" -a "X${natd_interface}" != X"" \
- -a "X${firewall_enable}" = X"YES" ]; then
- echo -n ' natd'; natd ${natd_flags} -n ${natd_interface}
- fi
+ if [ "X${natd_enable}" = X"YES" -a X"${natd_interface}" != X"" \
+ -a X"${firewall_enable}" = X"YES" ]; then
+ if echo ${natd_interface} | \
+ grep -q -E '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$'; then
+ natd_ifarg="-a ${natd_interface}"
+ else
+ natd_ifarg="-n ${natd_interface}"
+ fi
+ echo -n ' natd'; natd ${natd_flags} ${natd_ifarg}
+ fi
echo '.'
network_pass3_done=YES
OpenPOWER on IntegriCloud