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:
parent
bb1f5b9403
commit
d2e760ca5d
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user