diff options
Diffstat (limited to 'data.d/vpn-wireguard')
-rw-r--r-- | data.d/vpn-wireguard/.gitignore | 1 | ||||
-rwxr-xr-x | data.d/vpn-wireguard/hooks/post-up | 47 | ||||
-rw-r--r-- | data.d/vpn-wireguard/peers/faiwoo.tyil.net | 5 | ||||
-rw-r--r-- | data.d/vpn-wireguard/peers/gaeru.tyil.net | 5 | ||||
-rw-r--r-- | data.d/vpn-wireguard/peers/jaomox.tyil.net | 5 | ||||
-rw-r--r-- | data.d/vpn-wireguard/peers/mieshu.tyil.net | 5 | ||||
-rw-r--r-- | data.d/vpn-wireguard/peers/nouki.tyil.net | 5 | ||||
-rw-r--r-- | data.d/vpn-wireguard/peers/oolah.tyil.net | 5 | ||||
-rw-r--r-- | data.d/vpn-wireguard/peers/qohrei.tyil.net | 5 | ||||
-rw-r--r-- | data.d/vpn-wireguard/peers/ricui.tyil.net | 5 |
10 files changed, 88 insertions, 0 deletions
diff --git a/data.d/vpn-wireguard/.gitignore b/data.d/vpn-wireguard/.gitignore new file mode 100644 index 0000000..ae60a25 --- /dev/null +++ b/data.d/vpn-wireguard/.gitignore @@ -0,0 +1 @@ +privkey diff --git a/data.d/vpn-wireguard/hooks/post-up b/data.d/vpn-wireguard/hooks/post-up new file mode 100755 index 0000000..edbcd50 --- /dev/null +++ b/data.d/vpn-wireguard/hooks/post-up @@ -0,0 +1,47 @@ +#!/usr/bin/env bash + +readonly COLOR_RESET="\033[0m" +readonly COLOR_OK="\033[32;1m" +readonly COLOR_NOK="\033[31;1m" +readonly BUFFER="$(mktemp)" + +main() { + printf "Verifying connectability...\n" + + # Ping all known hosts, as it seems that the wireguard interface comes up when + # only after it gets used on the machine itself. + while read -r addr; + do + check "$addr" & + done < <(awk -F= '/vpn-wireguard.ipv(4|6)=/ { print $NF }' /etc/bashtard/hosts.d/*) + + wait + + sort -- "$BUFFER" >&2 +} + +check() { + local addr="$1" + + if ping -c 1 -q -w 1 "$addr" > /dev/null + then + log OK "$addr" + else + log NOK "$addr" + fi +} + +log() { + local state="$1" + local addr="$2" + local color="$COLOR_NOK" + + if [[ $state == "OK" ]] + then + color="$COLOR_OK" + fi + + printf "%b%3s%b: %s\n" "$color" "$state" "$COLOR_RESET" "$addr" >> "$BUFFER" +} + +main "$@" diff --git a/data.d/vpn-wireguard/peers/faiwoo.tyil.net b/data.d/vpn-wireguard/peers/faiwoo.tyil.net new file mode 100644 index 0000000..631f39a --- /dev/null +++ b/data.d/vpn-wireguard/peers/faiwoo.tyil.net @@ -0,0 +1,5 @@ +[Peer] +AllowedIPs = fd68:1058:1992:3381:0:1:1:2/128,10.58.1.2/32,fd00:8:0:3::/64,172.28.3.0/24 +Endpoint = [2a01:4f9:c010:e20c::1]:51820 +PublicKey = Rrl9qa09Gc8LM3CIr0BIMTnkCMhL1GZFVKCh1P2okWg= +PersistentKeepalive = 10 diff --git a/data.d/vpn-wireguard/peers/gaeru.tyil.net b/data.d/vpn-wireguard/peers/gaeru.tyil.net new file mode 100644 index 0000000..4b65f52 --- /dev/null +++ b/data.d/vpn-wireguard/peers/gaeru.tyil.net @@ -0,0 +1,5 @@ +[Peer] +AllowedIPs = fd68:1058:1992:3381:0:1:2:1/128,10.58.1.5/32 +Endpoint = [37.48.120.26]:51820 +PublicKey = np17FGeZB0N77/SfaHfKTbsD/oV0LnjdOUeIMePGQG4= +PersistentKeepalive = 10 diff --git a/data.d/vpn-wireguard/peers/jaomox.tyil.net b/data.d/vpn-wireguard/peers/jaomox.tyil.net new file mode 100644 index 0000000..15c3dc2 --- /dev/null +++ b/data.d/vpn-wireguard/peers/jaomox.tyil.net @@ -0,0 +1,5 @@ +[Peer] +AllowedIPs = fd68:1058:1992:3381:0:3:3:1/128,10.58.3.1/32 +Endpoint = [163.172.218.246]:51820 +PublicKey = VBqMAsZkCNVlqaMZGT7SKDuCkjXcVrwZNCxVKBRII0Q= +PersistentKeepalive = 10 diff --git a/data.d/vpn-wireguard/peers/mieshu.tyil.net b/data.d/vpn-wireguard/peers/mieshu.tyil.net new file mode 100644 index 0000000..0b9001f --- /dev/null +++ b/data.d/vpn-wireguard/peers/mieshu.tyil.net @@ -0,0 +1,5 @@ +[Peer] +AllowedIPs = fd68:1058:1992:3381:0:3:3317:2/128,10.58.3.2/32 +Endpoint = [2a10:3781:2453:1:4950:47ce:f8db:1fed]:51820 +PublicKey = hrVjitF/wpaNvL9/hlswTL/G8hhKcpMmqGsinU34IBA= +PersistentKeepalive = 10 diff --git a/data.d/vpn-wireguard/peers/nouki.tyil.net b/data.d/vpn-wireguard/peers/nouki.tyil.net new file mode 100644 index 0000000..0986864 --- /dev/null +++ b/data.d/vpn-wireguard/peers/nouki.tyil.net @@ -0,0 +1,5 @@ +[Peer] +AllowedIPs = fd68:1058:1992:3381:0:2:3317:1/128,10.58.2.1/32 +Endpoint = [2a10:3781:2453:1:c8cb:d1a:bc0:dc38]:51820 +PublicKey = Mo2jVPUCIX3o5fY+H2rrVMWAKatVrF9nF75OCZZhRGM= +PersistentKeepalive = 10 diff --git a/data.d/vpn-wireguard/peers/oolah.tyil.net b/data.d/vpn-wireguard/peers/oolah.tyil.net new file mode 100644 index 0000000..2951f1f --- /dev/null +++ b/data.d/vpn-wireguard/peers/oolah.tyil.net @@ -0,0 +1,5 @@ +[Peer] +AllowedIPs = fd68:1058:1992:3381:0:1:3317:1/128,10.58.1.4/32,fd00:8:0:0::/64,172.28.0.0/24 +Endpoint = [2a10:3781:2453:1:7aaf:8ff:fe7a:9ba8]:51820 +PublicKey = 8UkQ71m0xVPJbQ4zySRqH/WXJm479zj5xcgeJVoBWi8= +PersistentKeepalive = 10 diff --git a/data.d/vpn-wireguard/peers/qohrei.tyil.net b/data.d/vpn-wireguard/peers/qohrei.tyil.net new file mode 100644 index 0000000..2a206d6 --- /dev/null +++ b/data.d/vpn-wireguard/peers/qohrei.tyil.net @@ -0,0 +1,5 @@ +[Peer] +AllowedIPs = fd68:1058:1992:3381:0:1:1:1/128,10.58.1.1/32,fd00:8:0:2::/64,172.28.2.0/24 +Endpoint = [2a01:4f9:c012:6273::1]:51820 +PublicKey = cD1NveEPXKKNdGcx9bO4+91b1abDwoUSGnF4dI1m0R4= +PersistentKeepalive = 10 diff --git a/data.d/vpn-wireguard/peers/ricui.tyil.net b/data.d/vpn-wireguard/peers/ricui.tyil.net new file mode 100644 index 0000000..a8cfdd7 --- /dev/null +++ b/data.d/vpn-wireguard/peers/ricui.tyil.net @@ -0,0 +1,5 @@ +[Peer] +AllowedIPs = fd68:1058:1992:3381:0:1:1:3/128,10.58.1.3/32,fd00:8:0:4::/64,172.28.4.0/24 +Endpoint = [2a01:4f8:1c1b:67d7::1]:51820 +PublicKey = Rv41YhKkhAVKefwlKtD0Uywv7r6a2/uhsdhWVcZUYyU= +PersistentKeepalive = 10 |