mirror of
https://github.com/hackacad/bastille.git
synced 2025-12-25 05:20:44 +01:00
Merge pull request #394 from adyxax/network-access-on-startup
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."
|
||||
continue
|
||||
fi
|
||||
## add ip4.addr to firewall table:jails
|
||||
pfctl -q -t jails -T add "${ip}"
|
||||
fi
|
||||
|
||||
## start the container
|
||||
@@ -102,13 +104,6 @@ for _jail in ${JAILS}; do
|
||||
bastille rdr "${_jail}" ${_rules}
|
||||
done < "${bastille_jailsdir}/${_jail}/rdr.conf"
|
||||
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
|
||||
echo
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user