init
This commit is contained in:
5
addclient.sh
Normal file
5
addclient.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
echo Peer Pubkey:
|
||||
read pubkey
|
||||
echo Matching end of IP \(10.10.0.?\):
|
||||
read ip
|
||||
wg set wg0 peer $pubkey allowed-ips 10.10.0.$ip/32,fd86:ea04:1111::$ip/128
|
||||
9
client.conf
Normal file
9
client.conf
Normal file
@@ -0,0 +1,9 @@
|
||||
[Interface]
|
||||
PrivateKey =
|
||||
Address = 10.10.0.<?>/32, fd86:ea04:1111::<?>/128
|
||||
DNS = 3.14.3.2,3.14.3.3
|
||||
|
||||
[Peer]
|
||||
PublicKey =
|
||||
Endpoint = wireguard.ducoterra.net:51820
|
||||
AllowedIPs = 0.0.0.0/0, ::/0
|
||||
6
genkey.sh
Normal file
6
genkey.sh
Normal file
@@ -0,0 +1,6 @@
|
||||
echo Client Name:
|
||||
read name
|
||||
mkdir $name
|
||||
cd $name
|
||||
wg genkey | tee $name"_privkey" | wg pubkey | tee $name"_pubkey"
|
||||
cp ../client.conf $name".conf"
|
||||
15
install.sh
Normal file
15
install.sh
Normal file
@@ -0,0 +1,15 @@
|
||||
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 =
|
||||
8
wg0.conf
Normal file
8
wg0.conf
Normal file
@@ -0,0 +1,8 @@
|
||||
[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 =
|
||||
Reference in New Issue
Block a user