Fixes #338 Network access on jail startup
This commit is contained in:
@@ -83,6 +83,8 @@ for _jail in ${JAILS}; do
|
|||||||
error_notify "Error: IP address (${ip}) already in use."
|
error_notify "Error: IP address (${ip}) already in use."
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
## add ip4.addr to firewall table:jails
|
||||||
|
pfctl -q -t jails -T add "${ip}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## start the container
|
## start the container
|
||||||
@@ -102,13 +104,6 @@ for _jail in ${JAILS}; do
|
|||||||
bastille rdr "${_jail}" ${_rules}
|
bastille rdr "${_jail}" ${_rules}
|
||||||
done < "${bastille_jailsdir}/${_jail}/rdr.conf"
|
done < "${bastille_jailsdir}/${_jail}/rdr.conf"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## add ip4.addr to firewall table:jails
|
|
||||||
if [ -n "${bastille_network_loopback}" ]; then
|
|
||||||
if grep -qw "interface.*=.*${bastille_network_loopback}" "${bastille_jailsdir}/${_jail}/jail.conf"; then
|
|
||||||
pfctl -q -t jails -T add "$(jls -j ${_jail} ip4.addr)"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
echo
|
echo
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user