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
This commit is contained in:
Jacques Vidrine 1998-07-08 15:40:53 +00:00
parent abe2fe8a8b
commit e4e737cd85
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=37514
7 changed files with 77 additions and 35 deletions

View File

@ -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,9 +269,15 @@ 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}
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 '.'

View File

@ -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,9 +269,15 @@ 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}
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 '.'

View File

@ -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,9 +269,15 @@ 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}
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 '.'

View File

@ -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,9 +269,15 @@ 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}
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 '.'

View File

@ -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,9 +269,15 @@ 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}
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 '.'

View File

@ -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,9 +269,15 @@ 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}
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 '.'

View File

@ -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,9 +269,15 @@ 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}
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 '.'