ansible-edda/playbooks/filesystem/yggdrasil/etc/network/interfaces.d/wg0.j2

19 lines
603 B
Django/Jinja

auto wg0
iface wg0 inet static
pre-up ip link add $IFACE type wireguard
pre-up wg setconf $IFACE /etc/wireguard/$IFACE.conf
pre-up ip link set mtu 1420 dev $IFACE
post-up /usr/local/sbin/post-up-$IFACE-inet.nft
post-up /usr/local/sbin/post-up-$IFACE-ipv4.nft
post-up ip route add default dev $IFACE table 66
pre-down ip route del default dev $IFACE table 66
pre-down /usr/local/sbin/pre-down-$IFACE-ipv4.nft
pre-down /usr/local/sbin/pre-down-$IFACE-inet.nft
post-down ip link del dev $IFACE
address {{ vpn_wg0_address }}
netmask {{ vpn_wg0_netmask }}