Skip to content

Commit 63af667

Browse files
authored
Merge pull request #9 from madeye/fix/nftables-ipv6-grep
fix: handle missing IPv6 address in nftables setup
2 parents b0855da + 07abfa3 commit 63af667

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

scripts/nftables_setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ sysctl -w net.ipv6.conf.all.forwarding=1 2>/dev/null || true
100100

101101
# Get interface IPs for SSH bypass
102102
IFACE_IP=$(ip -4 addr show "$IFACE" | grep -oP 'inet \K[0-9.]+' | head -1)
103-
IFACE_IP6=$(ip -6 addr show "$IFACE" scope global | grep -oP 'inet6 \K[0-9a-f:]+' | head -1)
103+
IFACE_IP6=$(ip -6 addr show "$IFACE" scope global 2>/dev/null | grep -oP 'inet6 \K[0-9a-f:]+' | head -1 || true)
104104

105105
# --- IPv4 table ---
106106
echo "Adding nftables IPv4 NAT redirect rules on $IFACE -> port $PORT..."

0 commit comments

Comments
 (0)