This commit is contained in:
Minecon724 2025-03-09 12:13:22 +01:00
commit 3e0c444272
No known key found for this signature in database
GPG key ID: 3CCC4D267742C8E8
14 changed files with 77 additions and 49 deletions

74
aio.sh
View file

@ -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 <<EOF > /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 <<EOF > /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 <<EOF > /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 <<EOF > /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

View file

@ -0,0 +1,2 @@
net.ipv6.conf.all.forwarding=1
# rp_filter not disabled; ipv4 thing

View file

@ -2,4 +2,4 @@
Name=igp-dummy0
[Network]
Address = fdfe:8d0:7450:100::/56
Address = 2001:db8:adde::/56

View file

@ -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

View file

@ -0,0 +1,10 @@
[Unit]
Description=Update DN42 ROA periodically
[Timer]
OnBootSec=2m
OnUnitActiveSec=15m
AccuracySec=1m
[Install]
WantedBy=timers.target

View file

@ -0,0 +1,7 @@
[Unit]
Description=Pingfinder
[Service]
Type=oneshot
Environment=UUID=[...]
ExecStart=/opt/pingfinder.sh

View file

@ -0,0 +1,9 @@
[Unit]
Description=Pingfind periodically
[Timer]
OnBootSec=1m
OnUnitActiveSec=1m
[Install]
WantedBy=timers.target

View file

@ -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

4
finish.sh Normal file
View file

@ -0,0 +1,4 @@
#!/bin/bash
systemctl start bird
systemctl start pingfinder.timer