Index: etc/defaults/rc.conf =================================================================== RCS file: /usr/home/ncvs/src/etc/defaults/rc.conf,v retrieving revision 1.252.2.21 diff -u -r1.252.2.21 rc.conf --- etc/defaults/rc.conf 6 Jun 2006 15:04:39 -0000 1.252.2.21 +++ etc/defaults/rc.conf 4 Jul 2006 22:20:49 -0000 @@ -566,6 +566,7 @@ #jail_example_rootdir="/usr/jail/default" # Jail's root directory #jail_example_hostname="default.domain.com" # Jail's hostname #jail_example_ip="192.168.0.10" # Jail's IP number +#jail_example_netmask="255.255.255.255" # Jail's IP netmask #jail_example_interface="" # Interface to create the IP alias on #jail_example_exec_start="/bin/sh /etc/rc" # command to execute in jail for starting #jail_example_exec_stop="/bin/sh /etc/rc.shutdown" # command to execute in jail for stopping Index: etc/rc.d/jail =================================================================== RCS file: /usr/home/ncvs/src/etc/rc.d/jail,v retrieving revision 1.23.2.7 diff -u -r1.23.2.7 jail --- etc/rc.d/jail 6 Jun 2006 15:04:39 -0000 1.23.2.7 +++ etc/rc.d/jail 4 Jul 2006 22:20:49 -0000 @@ -33,6 +33,8 @@ _procdir="${_rootdir}/proc" eval _hostname=\"\$jail_${_j}_hostname\" eval _ip=\"\$jail_${_j}_ip\" + eval _netmask=\"\$jail_${_j}_netmask\" + [ -z "${_netmask}" ] && _netmask="255.255.255.255" eval _interface=\"\${jail_${_j}_interface:-${jail_interface}}\" eval _exec=\"\$jail_${_j}_exec\" eval _exec_start=\"\${jail_${_j}_exec_start:-${jail_exec_start}}\" @@ -76,6 +78,7 @@ debug "$_j mount enable: $_mount" debug "$_j hostname: $_hostname" debug "$_j ip: $_ip" + debug "$_j netmask: $_netmask" debug "$_j interface: $_interface" debug "$_j root: $_rootdir" debug "$_j devdir: $_devdir" @@ -96,6 +99,9 @@ if [ -z "${_ip}" ]; then err 3 "$name: No IP address has been defined for ${_j}" fi + if [ -z "${_netmask}" ]; then + err 3 "$name: No netmask has been defined for ${_j}" + fi } @@ -176,7 +182,7 @@ continue; fi if [ -n "${_interface}" ]; then - ifconfig ${_interface} alias ${_ip} netmask 255.255.255.255 + ifconfig ${_interface} alias ${_ip} netmask ${_netmask} fi if checkyesno _mount; then info "Mounting fstab for jail ${_jail} (${_fstab})" Index: share/man/man5/rc.conf.5 =================================================================== RCS file: /usr/home/ncvs/src/share/man/man5/rc.conf.5,v retrieving revision 1.256.2.23 diff -u -r1.256.2.23 rc.conf.5 --- share/man/man5/rc.conf.5 6 Jun 2006 15:04:39 -0000 1.256.2.23 +++ share/man/man5/rc.conf.5 4 Jul 2006 22:20:49 -0000 @@ -3133,6 +3133,13 @@ Unset by default. Set to the IP address assigned to jail .Va jname . +.It Va jail_ Ns Ao Ar jname Ac Ns Va _netmask +.Pq Vt str +Set to the netmask assigned to jail +.Va jname . +Set to +.Dq Li 255.255.255.255 +by default. .It Va jail_ Ns Ao Ar jname Ac Ns Va _flags .Pq Vt str Set to