dn42-configs/aio.sh

81 lines
1.8 KiB
Bash
Raw Normal View History

2024-10-08 17:41:49 +02:00
echo Installing bird and wireguard
apt install wireguard-tools bird2
systemctl stop bird
###########################################
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
###########################################
echo Now installing sysctl
cat <<EOF > /etc/sysctl.d/99-dn42.conf
net.ipv6.conf.all.forwarding=1
EOF
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
systemctl enable --now dn42-roa.timer
###########################################
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
###########################################
echo Don\'t forget to create an igp-dummy0
echo After done configuring, do:
echo systemctl start bird
echo