Fix route command for IPv6

Route needs to know we're passing it an IPv6 address:

```
# route -n get fec0:0:0:3::80
route: bad address: fec0:0:0:3::80
```
This commit is contained in:
Pietro Cerutti
2025-05-06 09:22:42 +02:00
committed by GitHub
parent bd0d177150
commit 32aa80849f

View File

@@ -173,7 +173,7 @@ for _jail in ${JAILS}; do
warn "[WARNING]: IP address (${_ip}) already in use, continuing..."
fi
## 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
if route -6 -n get ${_ip} | grep "gateway" >/dev/null; then
pfctl -q -t "${bastille_network_pf_table}" -T add "${_ip}"
fi
else