Skip to content

Commit

Permalink
Explicitly add routes for IPv4 and IPv6
Browse files Browse the repository at this point in the history
The default is v4, but since there's no IP address in the command that `ip` can
use to disambiguate let's be explicit.
  • Loading branch information
chrisbouchard committed Feb 21, 2022
1 parent 0ac54bb commit c23bcf1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bin/namespaced-wireguard-vpn-interface
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c23bcf1

Please sign in to comment.