diff options
-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 | ||||
-rw-r--r-- | share/man/man5/rc.conf.5 | 6 |
9 files changed, 30 insertions, 41 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 diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5 index 6df443e..7fee1f6 100644 --- a/share/man/man5/rc.conf.5 +++ b/share/man/man5/rc.conf.5 @@ -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 |