Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1e849d41af | |||
| 0a93940442 | |||
| 2c932cf281 | |||
| e7eb9b7717 | |||
| 27e88d45d5 | |||
| 721a5ca6a0 | |||
| 91f479e5d7 | |||
| f35de69b28 | |||
| e078aed54a | |||
| 848be8d8e3 | |||
| aa688f7072 | |||
| 9fc8804f97 | |||
| d6b5733d48 | |||
| 72bd211f7b |
@@ -22,6 +22,15 @@ bootstrapped release and a private (rfc1918) IP address.
|
|||||||
This command will create a 11.3-RELEASE container assigning the 10.17.89.10 ip
|
This command will create a 11.3-RELEASE container assigning the 10.17.89.10 ip
|
||||||
address to the new system.
|
address to the new system.
|
||||||
|
|
||||||
|
.. code-block:: shell
|
||||||
|
|
||||||
|
ishmael ~ # bastille create alcatraz 13.2-RELEASE 10.17.89.113/24
|
||||||
|
|
||||||
|
|
||||||
|
The above code will create a jail with a /24 mask. At the time of this documentation you
|
||||||
|
can only use CIDR notation, and not use a netmask 255.255.255.0 to accomplish this.
|
||||||
|
|
||||||
|
|
||||||
I recommend using private (rfc1918) ip address ranges for your container. These
|
I recommend using private (rfc1918) ip address ranges for your container. These
|
||||||
ranges include:
|
ranges include:
|
||||||
|
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ bastille_compress_xz_options="-0 -v" ## default
|
|||||||
bastille_decompress_xz_options="-c -d -v" ## default "-c -d -v"
|
bastille_decompress_xz_options="-c -d -v" ## default "-c -d -v"
|
||||||
bastille_compress_gz_options="-1 -v" ## default "-1 -v"
|
bastille_compress_gz_options="-1 -v" ## default "-1 -v"
|
||||||
bastille_decompress_gz_options="-k -d -c -v" ## default "-k -d -c -v"
|
bastille_decompress_gz_options="-k -d -c -v" ## default "-k -d -c -v"
|
||||||
|
bastille_export_options="" ## default "" predefined export options, e.g. "--safe --gz"
|
||||||
|
|
||||||
## Networking
|
## Networking
|
||||||
bastille_network_loopback="bastille0" ## default: "bastille0"
|
bastille_network_loopback="bastille0" ## default: "bastille0"
|
||||||
|
|||||||
@@ -152,6 +152,11 @@ update_jailconf() {
|
|||||||
sed -i '' "s|path.*=.*;|path = ${bastille_jailsdir}/${TARGET_TRIM}/root;|" "${JAIL_CONFIG}"
|
sed -i '' "s|path.*=.*;|path = ${bastille_jailsdir}/${TARGET_TRIM}/root;|" "${JAIL_CONFIG}"
|
||||||
sed -i '' "s|mount.fstab.*=.*;|mount.fstab = ${bastille_jailsdir}/${TARGET_TRIM}/fstab;|" "${JAIL_CONFIG}"
|
sed -i '' "s|mount.fstab.*=.*;|mount.fstab = ${bastille_jailsdir}/${TARGET_TRIM}/fstab;|" "${JAIL_CONFIG}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Check for the jib script
|
||||||
|
if grep -qw "vnet" "${JAIL_CONFIG}"; then
|
||||||
|
vnet_requirements
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -209,6 +214,7 @@ generate_config() {
|
|||||||
# See if we need to generate a vnet network section
|
# See if we need to generate a vnet network section
|
||||||
if [ "${IS_VNET_JAIL:-0}" = "1" ]; then
|
if [ "${IS_VNET_JAIL:-0}" = "1" ]; then
|
||||||
NETBLOCK=$(generate_vnet_jail_netblock "${TARGET_TRIM}" "" "${VNET_DEFAULT_INTERFACE}")
|
NETBLOCK=$(generate_vnet_jail_netblock "${TARGET_TRIM}" "" "${VNET_DEFAULT_INTERFACE}")
|
||||||
|
vnet_requirements
|
||||||
else
|
else
|
||||||
# If there are multiple IP/NIC let the user configure network
|
# If there are multiple IP/NIC let the user configure network
|
||||||
if [ -n "${IPV4_CONFIG}" ]; then
|
if [ -n "${IPV4_CONFIG}" ]; then
|
||||||
@@ -335,6 +341,17 @@ workout_components() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vnet_requirements() {
|
||||||
|
# VNET jib script requirement
|
||||||
|
if [ ! "$(command -v jib)" ]; then
|
||||||
|
if [ -f "/usr/share/examples/jails/jib" ] && [ ! -f "/usr/local/bin/jib" ]; then
|
||||||
|
install -m 0544 /usr/share/examples/jails/jib /usr/local/bin/jib
|
||||||
|
else
|
||||||
|
warn "Warning: Unable to locate/install jib script required by VNET jails."
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
config_netif() {
|
config_netif() {
|
||||||
# Get interface from bastille configuration
|
# Get interface from bastille configuration
|
||||||
if [ -n "${bastille_network_loopback}" ]; then
|
if [ -n "${bastille_network_loopback}" ]; then
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ fi
|
|||||||
bastille_root_check
|
bastille_root_check
|
||||||
|
|
||||||
if [ $# -eq 0 ]; then
|
if [ $# -eq 0 ]; then
|
||||||
/usr/sbin/jls -N
|
/usr/sbin/jls
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${1}" == "-j" ]; then
|
if [ "${1}" == "-j" ]; then
|
||||||
|
|||||||
@@ -88,9 +88,11 @@ check_jail_validity() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if ext_if is defined in pf.conf
|
# Check if ext_if is defined in pf.conf
|
||||||
EXT_IF=$(grep "^[[:space:]]*${bastille_network_pf_ext_if}[[:space:]]*=" ${bastille_pf_conf})
|
if [ -n "${bastille_pf_conf}" ]; then
|
||||||
if [ -z "${EXT_IF}" ]; then
|
EXT_IF=$(grep "^[[:space:]]*${bastille_network_pf_ext_if}[[:space:]]*=" ${bastille_pf_conf})
|
||||||
error_exit "bastille_network_pf_ext_if (${bastille_network_pf_ext_if}) not defined in pf.conf"
|
if [ -z "${EXT_IF}" ]; then
|
||||||
|
error_exit "bastille_network_pf_ext_if (${bastille_network_pf_ext_if}) not defined in pf.conf"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -118,7 +118,9 @@ release_update() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
env PAGER="/bin/cat" freebsd-update ${OPTION} --not-running-from-cron -b "${bastille_releasesdir}/${TARGET}" \
|
env PAGER="/bin/cat" freebsd-update ${OPTION} --not-running-from-cron -b "${bastille_releasesdir}/${TARGET}" \
|
||||||
fetch install --currently-running "${TARGET_TRIM}"
|
fetch --currently-running "${TARGET_TRIM}"
|
||||||
|
env PAGER="/bin/cat" freebsd-update ${OPTION} --not-running-from-cron -b "${bastille_releasesdir}/${TARGET}" \
|
||||||
|
install --currently-running "${TARGET_TRIM}"
|
||||||
else
|
else
|
||||||
error_exit "${TARGET} not found. See 'bastille bootstrap'."
|
error_exit "${TARGET} not found. See 'bastille bootstrap'."
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ jail_check() {
|
|||||||
|
|
||||||
release_check() {
|
release_check() {
|
||||||
# Validate the release
|
# Validate the release
|
||||||
if ! echo "${NEWRELEASE}" | grep -q "[0-9]\{2\}.[0-9]-RELEASE"; then
|
if ! echo "${NEWRELEASE}" | grep -q "[0-9]\{2\}.[0-9]-[RELEASE,BETA,RC]"; then
|
||||||
error_exit "${NEWRELEASE} is not a valid release."
|
error_exit "${NEWRELEASE} is not a valid release."
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user