summaryrefslogtreecommitdiff
path: root/roles/network/wireguard/gateway/templates/systemd-fix-default-gw.service.j2
blob: d2d8a4709c0369ab7704b7b85fc66c3832934d1b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
[Unit]
Wants=network-online.target
After=network-online.target

[Service]
Type=oneshot
ExecStart=/sbin/ip route add {{ item.value.default_gateway.outer }} via {{ ansible_default_ipv4.gateway }}
ExecStop=/sbin/ip route del {{ item.value.default_gateway.outer }} via {{ ansible_default_ipv4.gateway }}
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target