From 821d9baa1ce9dda48595b145423f58a40529bc7d Mon Sep 17 00:00:00 2001 From: ru Date: Wed, 24 Sep 2008 15:18:27 +0000 Subject: Allow a jail's IP alias to be created with an arbitrary netmask. MFC after: 3 days --- etc/rc.d/jail | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'etc') diff --git a/etc/rc.d/jail b/etc/rc.d/jail index 87eab69..851bf3c 100755 --- a/etc/rc.d/jail +++ b/etc/rc.d/jail @@ -39,6 +39,7 @@ init_variables() _procdir="${_rootdir}/proc" eval _hostname=\"\$jail_${_j}_hostname\" eval _ip=\"\$jail_${_j}_ip\" + eval _netmask=\"\${jail_${_j}_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}}\" @@ -93,6 +94,7 @@ init_variables() debug "$_j mount enable: $_mount" debug "$_j hostname: $_hostname" debug "$_j ip: $_ip" + debug "$_j netmask: $_netmask" debug "$_j interface: $_interface" debug "$_j fib: $_fib" debug "$_j root: $_rootdir" @@ -297,7 +299,7 @@ jail_start() continue; fi if [ -n "${_interface}" ]; then - ifconfig ${_interface} alias ${_ip} netmask 255.255.255.255 + ifconfig ${_interface} alias ${_ip} netmask ${_netmask} fi if [ -n "${_fib}" ]; then _setfib="setfib -F '${_fib}'" -- cgit v1.1