mirror of
https://github.com/hackacad/bastille.git
synced 2025-12-21 17:52:01 +01:00
start: Do not add IP to firewall table if it is in the same subnet
This commit is contained in:
@@ -108,7 +108,10 @@ for _jail in ${JAILS}; do
|
||||
if ifconfig | grep -qwF "${_ip}"; then
|
||||
warn "Warning: IP address (${_ip}) already in use, continuing..."
|
||||
fi
|
||||
pfctl -q -t "${bastille_network_pf_table}" -T add "${_ip}"
|
||||
## add ip to firewall table if it is not reachable through local interface (assumes NAT/rdr is needed)
|
||||
if route -n get ${_ip} | grep "gateway" >/dev/null; then
|
||||
pfctl -q -t "${bastille_network_pf_table}" -T add "${_ip}"
|
||||
fi
|
||||
else
|
||||
error_continue "Error: ${_if} interface does not exist."
|
||||
fi
|
||||
@@ -128,7 +131,10 @@ for _jail in ${JAILS}; do
|
||||
if ifconfig | grep -qwF "${_ip}"; then
|
||||
warn "Warning: IP address (${_ip}) already in use, continuing..."
|
||||
fi
|
||||
pfctl -q -t "${bastille_network_pf_table}" -T add "${_ip}"
|
||||
## add ip to firewall table if it is not reachable through local interface (assumes NAT/rdr is needed)
|
||||
if route -n get ${_ip} | grep "gateway" >/dev/null; then
|
||||
pfctl -q -t "${bastille_network_pf_table}" -T add "${_ip}"
|
||||
fi
|
||||
else
|
||||
error_continue "Error: ${_if} interface does not exist."
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user