Different Netmasks for jails

Roger Gujord roger at gujord.com
Fri Jun 29 08:25:56 UTC 2007


I managed to do what I wanted by adding the following to /etc/rc.d/jail:

# init_variables _j
eval _netmask=\"\$jail_${_j}_netmask\"

# Debugging aid
debug "$_j netmask: $_netmask"
if [ -z "${_netmask}" ]; then
    err 3 "$name: No netmask has been defined for ${_j}"

# jail_start()
ifconfig ${_interface} alias ${_ip} netmask ${_netmask}

and the following for each jail in /etc/rc.conf:

I'm not sure if this is the proper way to do it, but it seems to work for me.


More information about the freebsd-jail mailing list