There is no reason to demand the administrator set 'natd_interface'

when running natd(8) out of the rc-files. It is perfectly valid for
the interface or alias address to be set in a natd(8) configuration
file, not on the command line. Also, loosen up the restrictions on
identifying an IP address argument in 'natd_interface.'

Fix the documentation, rc.conf(5), to reflect this change.

Take the bogus default for 'natd_interface' out of /etc/defaults/rc.conf.

MFC after:	3 days
This commit is contained in:
Crist J. Clark 2002-02-20 10:31:01 +00:00
parent c80f5647cb
commit 29c0f078e2
9 changed files with 30 additions and 41 deletions

View File

@ -60,7 +60,7 @@ ipsec_enable="NO" # Set to YES to run setkey on ipsec_file
ipsec_file="/etc/ipsec.conf" # Name of config file for setkey
natd_program="/sbin/natd" # path to natd, if you want a different one.
natd_enable="NO" # Enable natd (if firewall_enable == YES).
natd_interface="fxp0" # Public interface or IPaddress to use.
natd_interface="" # Public interface or IPaddress to use.
natd_flags="" # Additional flags for natd.
ipfilter_enable="NO" # Set to YES to enable ipfilter functionality
ipfilter_program="/sbin/ipf" # where the ipfilter program lives

View File

@ -344,14 +344,13 @@ network_pass1() {
[Yy][Ee][Ss])
if [ -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}"
grep -q -E '^[0-9]+(\.[0-9]+){0,3}$'; then
natd_flags="$natd_flags -a ${natd_interface}"
else
natd_ifarg="-n ${natd_interface}"
natd_flags="$natd_flags -n ${natd_interface}"
fi
echo -n ' natd'; ${natd_program:-/sbin/natd} ${natd_flags} ${natd_ifarg}
fi
echo -n ' natd'; ${natd_program:-/sbin/natd} ${natd_flags}
;;
esac

View File

@ -344,14 +344,13 @@ network_pass1() {
[Yy][Ee][Ss])
if [ -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}"
grep -q -E '^[0-9]+(\.[0-9]+){0,3}$'; then
natd_flags="$natd_flags -a ${natd_interface}"
else
natd_ifarg="-n ${natd_interface}"
natd_flags="$natd_flags -n ${natd_interface}"
fi
echo -n ' natd'; ${natd_program:-/sbin/natd} ${natd_flags} ${natd_ifarg}
fi
echo -n ' natd'; ${natd_program:-/sbin/natd} ${natd_flags}
;;
esac

View File

@ -344,14 +344,13 @@ network_pass1() {
[Yy][Ee][Ss])
if [ -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}"
grep -q -E '^[0-9]+(\.[0-9]+){0,3}$'; then
natd_flags="$natd_flags -a ${natd_interface}"
else
natd_ifarg="-n ${natd_interface}"
natd_flags="$natd_flags -n ${natd_interface}"
fi
echo -n ' natd'; ${natd_program:-/sbin/natd} ${natd_flags} ${natd_ifarg}
fi
echo -n ' natd'; ${natd_program:-/sbin/natd} ${natd_flags}
;;
esac

View File

@ -344,14 +344,13 @@ network_pass1() {
[Yy][Ee][Ss])
if [ -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}"
grep -q -E '^[0-9]+(\.[0-9]+){0,3}$'; then
natd_flags="$natd_flags -a ${natd_interface}"
else
natd_ifarg="-n ${natd_interface}"
natd_flags="$natd_flags -n ${natd_interface}"
fi
echo -n ' natd'; ${natd_program:-/sbin/natd} ${natd_flags} ${natd_ifarg}
fi
echo -n ' natd'; ${natd_program:-/sbin/natd} ${natd_flags}
;;
esac

View File

@ -344,14 +344,13 @@ network_pass1() {
[Yy][Ee][Ss])
if [ -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}"
grep -q -E '^[0-9]+(\.[0-9]+){0,3}$'; then
natd_flags="$natd_flags -a ${natd_interface}"
else
natd_ifarg="-n ${natd_interface}"
natd_flags="$natd_flags -n ${natd_interface}"
fi
echo -n ' natd'; ${natd_program:-/sbin/natd} ${natd_flags} ${natd_ifarg}
fi
echo -n ' natd'; ${natd_program:-/sbin/natd} ${natd_flags}
;;
esac

View File

@ -344,14 +344,13 @@ network_pass1() {
[Yy][Ee][Ss])
if [ -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}"
grep -q -E '^[0-9]+(\.[0-9]+){0,3}$'; then
natd_flags="$natd_flags -a ${natd_interface}"
else
natd_ifarg="-n ${natd_interface}"
natd_flags="$natd_flags -n ${natd_interface}"
fi
echo -n ' natd'; ${natd_program:-/sbin/natd} ${natd_flags} ${natd_ifarg}
fi
echo -n ' natd'; ${natd_program:-/sbin/natd} ${natd_flags}
;;
esac

View File

@ -344,14 +344,13 @@ network_pass1() {
[Yy][Ee][Ss])
if [ -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}"
grep -q -E '^[0-9]+(\.[0-9]+){0,3}$'; then
natd_flags="$natd_flags -a ${natd_interface}"
else
natd_ifarg="-n ${natd_interface}"
natd_flags="$natd_flags -n ${natd_interface}"
fi
echo -n ' natd'; ${natd_program:-/sbin/natd} ${natd_flags} ${natd_ifarg}
fi
echo -n ' natd'; ${natd_program:-/sbin/natd} ${natd_flags}
;;
esac

View File

@ -263,11 +263,7 @@ and
sockets must be enabled in the kernel.
.It Va natd_interface
.Pq Vt str
This is the name of the public interface on which natd should run. It
is mandatory if
.Va natd_enable
is set to
.Dq YES .
This is the name of the public interface on which natd should run.
The interface may be given as an interface name or as an IP address.
.It Va natd_flags
.Pq Vt str