From 3e0c444272b26a15c52dd338b7b55a7bc2b3fdc1 Mon Sep 17 00:00:00 2001 From: Minecon724 Date: Sun, 9 Mar 2025 12:13:22 +0100 Subject: [PATCH] Changes --- aio.sh | 74 +++++++------------ {bird => etc/bird}/babel.conf | 0 {bird => etc/bird}/bird.conf | 0 {bird => etc/bird}/community_filters.conf | 0 etc/sysctl.d/99-dn42.conf | 2 + .../systemd/network}/igp-dummy0.netdev | 0 .../systemd/network}/igp-dummy0.network | 2 +- etc/systemd/system/dn42-roa.service | 7 ++ etc/systemd/system/dn42-roa.timer | 10 +++ etc/systemd/system/pingfinder.service | 7 ++ etc/systemd/system/pingfinder.timer | 9 +++ etc/wireguard/template.conf | 11 +++ finish.sh | 4 + pingfinder.sh => usr/local/bin/pingfinder.sh | 0 14 files changed, 77 insertions(+), 49 deletions(-) rename {bird => etc/bird}/babel.conf (100%) rename {bird => etc/bird}/bird.conf (100%) rename {bird => etc/bird}/community_filters.conf (100%) create mode 100644 etc/sysctl.d/99-dn42.conf rename {networkd => etc/systemd/network}/igp-dummy0.netdev (100%) rename {networkd => etc/systemd/network}/igp-dummy0.network (51%) create mode 100644 etc/systemd/system/dn42-roa.service create mode 100644 etc/systemd/system/dn42-roa.timer create mode 100644 etc/systemd/system/pingfinder.service create mode 100644 etc/systemd/system/pingfinder.timer create mode 100644 etc/wireguard/template.conf create mode 100644 finish.sh rename pingfinder.sh => usr/local/bin/pingfinder.sh (100%) diff --git a/aio.sh b/aio.sh index 373b0eb..90fc483 100644 --- a/aio.sh +++ b/aio.sh @@ -1,4 +1,6 @@ -echo Installing bird and wireguard +#!/bin/bash + +echo Installing bird and wireguard. Confirm! apt install wireguard-tools bird2 systemctl stop bird @@ -10,71 +12,47 @@ echo Generating WG keypair wg genkey > /etc/wireguard/privkey cat /etc/wireguard/privkey | wg pubkey > /etc/wireguard/pubkey -cat < /etc/wireguard/template.conf -[Interface] -ListenPort = 42401 -PrivateKey = [...] -PostUp = /sbin/ip addr add dev %i fe80::129:3/128 peer fe80::129:1/128 -Table = off - -[Peer] -Endpoint = pl1.420129.xyz:42403 -PublicKey = [...] -PresharedKey = [...] -AllowedIPs = ::/0 -EOF +cp etc/wireguard/* /etc/wireguard/ ########################################### echo Now installing sysctl -cat < /etc/sysctl.d/99-dn42.conf -net.ipv6.conf.all.forwarding=1 -EOF - +cp etc/sysctl.d/* /etc/sysctl.d/ sysctl --system ########################################### echo Now installing ROA updater -cat < /etc/systemd/system/dn42-roa.service -[Unit] -Description=Update DN42 ROA - -[Service] -Type=oneshot -ExecStart=curl -sfSLR -o /etc/bird/roa_dn42_v6.conf -z /etc/bird/roa_dn42_v6.conf https://dn42.burble.com/roa/dn42_roa_bird2_6.conf -ExecStart=birdc configure -EOF - -cat < /etc/systemd/system/dn42-roa.timer -[Unit] -Description=Update DN42 ROA periodically - -[Timer] -OnBootSec=2m -OnUnitActiveSec=15m -AccuracySec=1m - -[Install] -WantedBy=timers.target -EOF - +cp etc/systemd/system/* /etc/systemd/system systemctl enable --now dn42-roa.timer ########################################### +echo Now installing networkd templates you will edit later + +cp etc/systemd/network* /etc/systemd/network + +########################################### + echo Now installing bird configs -mkdir /etc/bird/peers -curl -Lo /etc/bird/bird.conf https://git.m724.eu/Minecon724/dn42-configs/raw/branch/master/bird/bird.conf -curl -Lo /etc/bird/community_filters.conf https://git.m724.eu/Minecon724/dn42-configs/raw/branch/master/bird/community_filters.conf -curl -Lo /etc/bird/babel.conf https://git.m724.eu/Minecon724/dn42-configs/raw/branch/master/bird/babel.conf +cp -r etc/bird/* /etc/bird ########################################### -echo Don\'t forget to create an igp-dummy0 -echo After done configuring, do: -echo systemctl start bird +echo Now installing pingfinder + +cp usr/local/bin /usr/local/bin +systemctl enable pingfinder.timer + +########################################### + +echo Don\'t forget to configure networkd! +echo And add some peers! +echo And configure pingfinder in /etc/systemd/system/pingfinder.service +echo +echo After done configuring, do: +echo sudo ./finish.sh echo diff --git a/bird/babel.conf b/etc/bird/babel.conf similarity index 100% rename from bird/babel.conf rename to etc/bird/babel.conf diff --git a/bird/bird.conf b/etc/bird/bird.conf similarity index 100% rename from bird/bird.conf rename to etc/bird/bird.conf diff --git a/bird/community_filters.conf b/etc/bird/community_filters.conf similarity index 100% rename from bird/community_filters.conf rename to etc/bird/community_filters.conf diff --git a/etc/sysctl.d/99-dn42.conf b/etc/sysctl.d/99-dn42.conf new file mode 100644 index 0000000..146e8cb --- /dev/null +++ b/etc/sysctl.d/99-dn42.conf @@ -0,0 +1,2 @@ +net.ipv6.conf.all.forwarding=1 +# rp_filter not disabled; ipv4 thing diff --git a/networkd/igp-dummy0.netdev b/etc/systemd/network/igp-dummy0.netdev similarity index 100% rename from networkd/igp-dummy0.netdev rename to etc/systemd/network/igp-dummy0.netdev diff --git a/networkd/igp-dummy0.network b/etc/systemd/network/igp-dummy0.network similarity index 51% rename from networkd/igp-dummy0.network rename to etc/systemd/network/igp-dummy0.network index 08162ea..596fca2 100644 --- a/networkd/igp-dummy0.network +++ b/etc/systemd/network/igp-dummy0.network @@ -2,4 +2,4 @@ Name=igp-dummy0 [Network] -Address = fdfe:8d0:7450:100::/56 +Address = 2001:db8:adde::/56 diff --git a/etc/systemd/system/dn42-roa.service b/etc/systemd/system/dn42-roa.service new file mode 100644 index 0000000..b6f14ad --- /dev/null +++ b/etc/systemd/system/dn42-roa.service @@ -0,0 +1,7 @@ +[Unit] +Description=Update DN42 ROA + +[Service] +Type=oneshot +ExecStart=curl -sfSLR -o /etc/bird/roa_dn42_v6.conf -z /etc/bird/roa_dn42_v6.conf https://lfs.m724.eu/roa/dn42_roa_bird2_6.conf +ExecStart=birdc configure diff --git a/etc/systemd/system/dn42-roa.timer b/etc/systemd/system/dn42-roa.timer new file mode 100644 index 0000000..a5ab76c --- /dev/null +++ b/etc/systemd/system/dn42-roa.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Update DN42 ROA periodically + +[Timer] +OnBootSec=2m +OnUnitActiveSec=15m +AccuracySec=1m + +[Install] +WantedBy=timers.target diff --git a/etc/systemd/system/pingfinder.service b/etc/systemd/system/pingfinder.service new file mode 100644 index 0000000..af7d14b --- /dev/null +++ b/etc/systemd/system/pingfinder.service @@ -0,0 +1,7 @@ +[Unit] +Description=Pingfinder + +[Service] +Type=oneshot +Environment=UUID=[...] +ExecStart=/opt/pingfinder.sh diff --git a/etc/systemd/system/pingfinder.timer b/etc/systemd/system/pingfinder.timer new file mode 100644 index 0000000..4c89b1a --- /dev/null +++ b/etc/systemd/system/pingfinder.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Pingfind periodically + +[Timer] +OnBootSec=1m +OnUnitActiveSec=1m + +[Install] +WantedBy=timers.target diff --git a/etc/wireguard/template.conf b/etc/wireguard/template.conf new file mode 100644 index 0000000..63d4f53 --- /dev/null +++ b/etc/wireguard/template.conf @@ -0,0 +1,11 @@ +[Interface] +ListenPort = 42401 +PrivateKey = [...] +PostUp = /sbin/ip addr add dev %i fe80::129:3/128 peer fe80::129:1/128 +Table = off + +[Peer] +Endpoint = pl1.420129.xyz:42403 +PublicKey = [...] +PresharedKey = [...] +AllowedIPs = ::/0 diff --git a/finish.sh b/finish.sh new file mode 100644 index 0000000..72838de --- /dev/null +++ b/finish.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +systemctl start bird +systemctl start pingfinder.timer diff --git a/pingfinder.sh b/usr/local/bin/pingfinder.sh similarity index 100% rename from pingfinder.sh rename to usr/local/bin/pingfinder.sh