diff --git a/packer/rootfs/etc/wireguard/wg0.conf b/packer/rootfs/etc/wireguard/wg0.conf index 1856e7b..aa737d0 100644 --- a/packer/rootfs/etc/wireguard/wg0.conf +++ b/packer/rootfs/etc/wireguard/wg0.conf @@ -9,9 +9,9 @@ PostUp = wg set '%i' private-key '/etc/wireguard/%i-privatekey' PostUp = [ -e '/etc/wireguard/%i-peers.conf' ] || (umask 022 && touch '/etc/wireguard/%i-peers.conf') PostUp = wg addconf '%i' '/etc/wireguard/%i-peers.conf' # Enable IPv4/IPv6 forwarding -PostUp = grep -Fxq '1' /proc/sys/net/ipv4/ip_forward || printf 1 > /proc/sys/net/ipv4/ip_forward -PostUp = grep -Fxq '1' /proc/sys/net/ipv6/conf/all/forwarding || printf 1 > /proc/sys/net/ipv6/conf/all/forwarding -PostUp = grep -Fxq '1' /proc/sys/net/ipv6/conf/default/forwarding || printf 1 > /proc/sys/net/ipv6/conf/default/forwarding +PostUp = grep -Fxq 1 /proc/sys/net/ipv4/ip_forward || printf 1 > /proc/sys/net/ipv4/ip_forward +PostUp = grep -Fxq 1 /proc/sys/net/ipv6/conf/all/forwarding || printf 1 > /proc/sys/net/ipv6/conf/all/forwarding +PostUp = grep -Fxq 1 /proc/sys/net/ipv6/conf/default/forwarding || printf 1 > /proc/sys/net/ipv6/conf/default/forwarding # Store the internet-facing interface in a file for later use PostUp = ip route show default | awk '/^default/{print $5}' > '/etc/wireguard/%i-iface' # Allow access WireGuard via port 51820/UDP on the internet-facing interface