aboutsummaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorBrian Somers <brian@FreeBSD.org>1999-03-24 10:28:49 +0000
committerBrian Somers <brian@FreeBSD.org>1999-03-24 10:28:49 +0000
commitcff5e07509d96338b8d4dca4a2bd8b6d06f98a83 (patch)
tree018128652bfa68ee7cf1c9078da79a92dfb0102b /etc
parent685e0fcbef54e2dce4620830c2a7bc450e2e4d1c (diff)
downloadsrc-cff5e07509d96338b8d4dca4a2bd8b6d06f98a83.tar.gz
src-cff5e07509d96338b8d4dca4a2bd8b6d06f98a83.zip
Move natd from network_pass3 to network_pass1
Notes
Notes: svn path=/head/; revision=44992
Diffstat (limited to 'etc')
-rw-r--r--etc/network.subr31
-rw-r--r--etc/rc.d/netoptions31
-rw-r--r--etc/rc.d/network131
-rw-r--r--etc/rc.d/network231
-rw-r--r--etc/rc.d/network331
-rw-r--r--etc/rc.d/routing31
-rw-r--r--etc/rc.network31
7 files changed, 105 insertions, 112 deletions
diff --git a/etc/network.subr b/etc/network.subr
index e54589fd135a..12300c095e78 100644
--- a/etc/network.subr
+++ b/etc/network.subr
@@ -1,6 +1,6 @@
#!/bin/sh -
#
-# $Id: rc.network,v 1.39 1999/01/13 17:32:37 joerg Exp $
+# $Id: rc.network,v 1.40 1999/03/11 16:17:24 jfitz Exp $
# From: @(#)netstart 5.9 (Berkeley) 3/30/91
# Note that almost all the user-configurable behavior is no longer in
@@ -100,10 +100,21 @@ network_pass1() {
# Load the filters if required
if [ $firewall_in_kernel = 1 ]; then
- if [ -n "$firewall_enable" -a -f /etc/rc.firewall -a \
- "x$firewall_enable" = "xYES" ] ; then
+ if [ -f /etc/rc.firewall -a X"$firewall_enable" = X"YES" ]; then
. /etc/rc.firewall
- echo "Firewall rules loaded."
+ echo -n 'Firewall rules loaded, starting divert daemons: '
+
+ # Network Address Translation daemon
+ if [ X"${natd_enable}" = X"YES" -a -n "${natd_interface}" ]; 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_program} ${natd_flags} ${natd_ifarg}
+ fi
+ echo '.'
else
IPFW_DEFAULT=`ipfw l 65535`
if [ "$IPFW_DEFAULT" = "65535 deny ip from any to any" ]; then
@@ -311,18 +322,6 @@ network_pass3() {
unset stash_flag
fi
- # Network Address Translation daemon
- 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
}
diff --git a/etc/rc.d/netoptions b/etc/rc.d/netoptions
index e54589fd135a..12300c095e78 100644
--- a/etc/rc.d/netoptions
+++ b/etc/rc.d/netoptions
@@ -1,6 +1,6 @@
#!/bin/sh -
#
-# $Id: rc.network,v 1.39 1999/01/13 17:32:37 joerg Exp $
+# $Id: rc.network,v 1.40 1999/03/11 16:17:24 jfitz Exp $
# From: @(#)netstart 5.9 (Berkeley) 3/30/91
# Note that almost all the user-configurable behavior is no longer in
@@ -100,10 +100,21 @@ network_pass1() {
# Load the filters if required
if [ $firewall_in_kernel = 1 ]; then
- if [ -n "$firewall_enable" -a -f /etc/rc.firewall -a \
- "x$firewall_enable" = "xYES" ] ; then
+ if [ -f /etc/rc.firewall -a X"$firewall_enable" = X"YES" ]; then
. /etc/rc.firewall
- echo "Firewall rules loaded."
+ echo -n 'Firewall rules loaded, starting divert daemons: '
+
+ # Network Address Translation daemon
+ if [ X"${natd_enable}" = X"YES" -a -n "${natd_interface}" ]; 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_program} ${natd_flags} ${natd_ifarg}
+ fi
+ echo '.'
else
IPFW_DEFAULT=`ipfw l 65535`
if [ "$IPFW_DEFAULT" = "65535 deny ip from any to any" ]; then
@@ -311,18 +322,6 @@ network_pass3() {
unset stash_flag
fi
- # Network Address Translation daemon
- 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
}
diff --git a/etc/rc.d/network1 b/etc/rc.d/network1
index e54589fd135a..12300c095e78 100644
--- a/etc/rc.d/network1
+++ b/etc/rc.d/network1
@@ -1,6 +1,6 @@
#!/bin/sh -
#
-# $Id: rc.network,v 1.39 1999/01/13 17:32:37 joerg Exp $
+# $Id: rc.network,v 1.40 1999/03/11 16:17:24 jfitz Exp $
# From: @(#)netstart 5.9 (Berkeley) 3/30/91
# Note that almost all the user-configurable behavior is no longer in
@@ -100,10 +100,21 @@ network_pass1() {
# Load the filters if required
if [ $firewall_in_kernel = 1 ]; then
- if [ -n "$firewall_enable" -a -f /etc/rc.firewall -a \
- "x$firewall_enable" = "xYES" ] ; then
+ if [ -f /etc/rc.firewall -a X"$firewall_enable" = X"YES" ]; then
. /etc/rc.firewall
- echo "Firewall rules loaded."
+ echo -n 'Firewall rules loaded, starting divert daemons: '
+
+ # Network Address Translation daemon
+ if [ X"${natd_enable}" = X"YES" -a -n "${natd_interface}" ]; 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_program} ${natd_flags} ${natd_ifarg}
+ fi
+ echo '.'
else
IPFW_DEFAULT=`ipfw l 65535`
if [ "$IPFW_DEFAULT" = "65535 deny ip from any to any" ]; then
@@ -311,18 +322,6 @@ network_pass3() {
unset stash_flag
fi
- # Network Address Translation daemon
- 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
}
diff --git a/etc/rc.d/network2 b/etc/rc.d/network2
index e54589fd135a..12300c095e78 100644
--- a/etc/rc.d/network2
+++ b/etc/rc.d/network2
@@ -1,6 +1,6 @@
#!/bin/sh -
#
-# $Id: rc.network,v 1.39 1999/01/13 17:32:37 joerg Exp $
+# $Id: rc.network,v 1.40 1999/03/11 16:17:24 jfitz Exp $
# From: @(#)netstart 5.9 (Berkeley) 3/30/91
# Note that almost all the user-configurable behavior is no longer in
@@ -100,10 +100,21 @@ network_pass1() {
# Load the filters if required
if [ $firewall_in_kernel = 1 ]; then
- if [ -n "$firewall_enable" -a -f /etc/rc.firewall -a \
- "x$firewall_enable" = "xYES" ] ; then
+ if [ -f /etc/rc.firewall -a X"$firewall_enable" = X"YES" ]; then
. /etc/rc.firewall
- echo "Firewall rules loaded."
+ echo -n 'Firewall rules loaded, starting divert daemons: '
+
+ # Network Address Translation daemon
+ if [ X"${natd_enable}" = X"YES" -a -n "${natd_interface}" ]; 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_program} ${natd_flags} ${natd_ifarg}
+ fi
+ echo '.'
else
IPFW_DEFAULT=`ipfw l 65535`
if [ "$IPFW_DEFAULT" = "65535 deny ip from any to any" ]; then
@@ -311,18 +322,6 @@ network_pass3() {
unset stash_flag
fi
- # Network Address Translation daemon
- 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
}
diff --git a/etc/rc.d/network3 b/etc/rc.d/network3
index e54589fd135a..12300c095e78 100644
--- a/etc/rc.d/network3
+++ b/etc/rc.d/network3
@@ -1,6 +1,6 @@
#!/bin/sh -
#
-# $Id: rc.network,v 1.39 1999/01/13 17:32:37 joerg Exp $
+# $Id: rc.network,v 1.40 1999/03/11 16:17:24 jfitz Exp $
# From: @(#)netstart 5.9 (Berkeley) 3/30/91
# Note that almost all the user-configurable behavior is no longer in
@@ -100,10 +100,21 @@ network_pass1() {
# Load the filters if required
if [ $firewall_in_kernel = 1 ]; then
- if [ -n "$firewall_enable" -a -f /etc/rc.firewall -a \
- "x$firewall_enable" = "xYES" ] ; then
+ if [ -f /etc/rc.firewall -a X"$firewall_enable" = X"YES" ]; then
. /etc/rc.firewall
- echo "Firewall rules loaded."
+ echo -n 'Firewall rules loaded, starting divert daemons: '
+
+ # Network Address Translation daemon
+ if [ X"${natd_enable}" = X"YES" -a -n "${natd_interface}" ]; 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_program} ${natd_flags} ${natd_ifarg}
+ fi
+ echo '.'
else
IPFW_DEFAULT=`ipfw l 65535`
if [ "$IPFW_DEFAULT" = "65535 deny ip from any to any" ]; then
@@ -311,18 +322,6 @@ network_pass3() {
unset stash_flag
fi
- # Network Address Translation daemon
- 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
}
diff --git a/etc/rc.d/routing b/etc/rc.d/routing
index e54589fd135a..12300c095e78 100644
--- a/etc/rc.d/routing
+++ b/etc/rc.d/routing
@@ -1,6 +1,6 @@
#!/bin/sh -
#
-# $Id: rc.network,v 1.39 1999/01/13 17:32:37 joerg Exp $
+# $Id: rc.network,v 1.40 1999/03/11 16:17:24 jfitz Exp $
# From: @(#)netstart 5.9 (Berkeley) 3/30/91
# Note that almost all the user-configurable behavior is no longer in
@@ -100,10 +100,21 @@ network_pass1() {
# Load the filters if required
if [ $firewall_in_kernel = 1 ]; then
- if [ -n "$firewall_enable" -a -f /etc/rc.firewall -a \
- "x$firewall_enable" = "xYES" ] ; then
+ if [ -f /etc/rc.firewall -a X"$firewall_enable" = X"YES" ]; then
. /etc/rc.firewall
- echo "Firewall rules loaded."
+ echo -n 'Firewall rules loaded, starting divert daemons: '
+
+ # Network Address Translation daemon
+ if [ X"${natd_enable}" = X"YES" -a -n "${natd_interface}" ]; 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_program} ${natd_flags} ${natd_ifarg}
+ fi
+ echo '.'
else
IPFW_DEFAULT=`ipfw l 65535`
if [ "$IPFW_DEFAULT" = "65535 deny ip from any to any" ]; then
@@ -311,18 +322,6 @@ network_pass3() {
unset stash_flag
fi
- # Network Address Translation daemon
- 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
}
diff --git a/etc/rc.network b/etc/rc.network
index e54589fd135a..12300c095e78 100644
--- a/etc/rc.network
+++ b/etc/rc.network
@@ -1,6 +1,6 @@
#!/bin/sh -
#
-# $Id: rc.network,v 1.39 1999/01/13 17:32:37 joerg Exp $
+# $Id: rc.network,v 1.40 1999/03/11 16:17:24 jfitz Exp $
# From: @(#)netstart 5.9 (Berkeley) 3/30/91
# Note that almost all the user-configurable behavior is no longer in
@@ -100,10 +100,21 @@ network_pass1() {
# Load the filters if required
if [ $firewall_in_kernel = 1 ]; then
- if [ -n "$firewall_enable" -a -f /etc/rc.firewall -a \
- "x$firewall_enable" = "xYES" ] ; then
+ if [ -f /etc/rc.firewall -a X"$firewall_enable" = X"YES" ]; then
. /etc/rc.firewall
- echo "Firewall rules loaded."
+ echo -n 'Firewall rules loaded, starting divert daemons: '
+
+ # Network Address Translation daemon
+ if [ X"${natd_enable}" = X"YES" -a -n "${natd_interface}" ]; 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_program} ${natd_flags} ${natd_ifarg}
+ fi
+ echo '.'
else
IPFW_DEFAULT=`ipfw l 65535`
if [ "$IPFW_DEFAULT" = "65535 deny ip from any to any" ]; then
@@ -311,18 +322,6 @@ network_pass3() {
unset stash_flag
fi
- # Network Address Translation daemon
- 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
}