diff options
author | cjc <cjc@FreeBSD.org> | 2002-02-20 10:31:01 +0000 |
---|---|---|
committer | cjc <cjc@FreeBSD.org> | 2002-02-20 10:31:01 +0000 |
commit | 5eebfcea9b91d92ee8dfb13175e8df4db32ba2bf (patch) | |
tree | b19652aa3fabe6cc71da57b47a1feb4dc4ac7582 /etc | |
parent | f41a9d6db54165b50cd0f2f6245a40b6843e8a5f (diff) | |
download | FreeBSD-src-5eebfcea9b91d92ee8dfb13175e8df4db32ba2bf.zip FreeBSD-src-5eebfcea9b91d92ee8dfb13175e8df4db32ba2bf.tar.gz |
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
Diffstat (limited to 'etc')
-rw-r--r-- | etc/defaults/rc.conf | 2 | ||||
-rw-r--r-- | etc/network.subr | 9 | ||||
-rw-r--r-- | etc/rc.d/netoptions | 9 | ||||
-rw-r--r-- | etc/rc.d/network1 | 9 | ||||
-rw-r--r-- | etc/rc.d/network2 | 9 | ||||
-rw-r--r-- | etc/rc.d/network3 | 9 | ||||
-rw-r--r-- | etc/rc.d/routing | 9 | ||||
-rw-r--r-- | etc/rc.network | 9 |
8 files changed, 29 insertions, 36 deletions
diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf index b9c0e3a..9c809ea 100644 --- a/etc/defaults/rc.conf +++ b/etc/defaults/rc.conf @@ -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 diff --git a/etc/network.subr b/etc/network.subr index a3ec576..303cd1f 100644 --- a/etc/network.subr +++ b/etc/network.subr @@ -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 diff --git a/etc/rc.d/netoptions b/etc/rc.d/netoptions index a3ec576..303cd1f 100644 --- a/etc/rc.d/netoptions +++ b/etc/rc.d/netoptions @@ -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 diff --git a/etc/rc.d/network1 b/etc/rc.d/network1 index a3ec576..303cd1f 100644 --- a/etc/rc.d/network1 +++ b/etc/rc.d/network1 @@ -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 diff --git a/etc/rc.d/network2 b/etc/rc.d/network2 index a3ec576..303cd1f 100644 --- a/etc/rc.d/network2 +++ b/etc/rc.d/network2 @@ -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 diff --git a/etc/rc.d/network3 b/etc/rc.d/network3 index a3ec576..303cd1f 100644 --- a/etc/rc.d/network3 +++ b/etc/rc.d/network3 @@ -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 diff --git a/etc/rc.d/routing b/etc/rc.d/routing index a3ec576..303cd1f 100644 --- a/etc/rc.d/routing +++ b/etc/rc.d/routing @@ -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 diff --git a/etc/rc.network b/etc/rc.network index a3ec576..303cd1f 100644 --- a/etc/rc.network +++ b/etc/rc.network @@ -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 |