From c23bcf155870332b93696ab0e2c22f9105633a53 Mon Sep 17 00:00:00 2001 From: Chris Bouchard Date: Mon, 21 Feb 2022 15:28:10 -0500 Subject: [PATCH] Explicitly add routes for IPv4 and IPv6 The default is v4, but since there's no IP address in the command that `ip` can use to disambiguate let's be explicit. --- bin/namespaced-wireguard-vpn-interface | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/namespaced-wireguard-vpn-interface b/bin/namespaced-wireguard-vpn-interface index 2ef35d9..d4d310d 100755 --- a/bin/namespaced-wireguard-vpn-interface +++ b/bin/namespaced-wireguard-vpn-interface @@ -23,7 +23,10 @@ case "$1" in ip -n "$NETNS_NAME" address add '{}' dev "$WIREGUARD_NAME" || die ip -n "$NETNS_NAME" link set "$WIREGUARD_NAME" up || die - ip -n "$NETNS_NAME" route add default dev "$WIREGUARD_NAME" || die + + # Add default routes for IPv4 and IPv6 + ip -n "$NETNS_NAME" -4 route add default dev "$WIREGUARD_NAME" || die + ip -n "$NETNS_NAME" -6 route add default dev "$WIREGUARD_NAME" || die ;; down)