15 lines
830 B
Bash
15 lines
830 B
Bash
echo "deb http://deb.debian.org/debian/ unstable main" > /etc/apt/sources.list.d/unstable.list
|
|
printf 'Package: *\nPin: release a=unstable\nPin-Priority: 90\n' > /etc/apt/preferences.d/limit-unstable
|
|
apt update
|
|
apt install -y wireguard qrencode
|
|
|
|
privkey=wg genkey | tee "privatekey" | wg pubkey | tee "publickey"
|
|
echo <<EOF
|
|
[Interface]
|
|
Address = 10.10.0.1/24
|
|
Address = fd86:ea04:1111::1/64
|
|
SaveConfig = true
|
|
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o ens3 -j MASQUERADE; ip6tables -A FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -A POSTROUTING -o ens3 -j MASQUERADE
|
|
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o ens3 -j MASQUERADE; ip6tables -D FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -D POSTROUTING -o ens3 -j MASQUERADE
|
|
ListenPort = 51820
|
|
PrivateKey = |