Vue lecture

Note: Config rapide wireguard

Config rapide wireguard

Sur la machine 1

apt install wireguard
cd /etc/wireguard/
umask 077; wg genkey | tee privatekey | wg pubkey > publickey
cat <<EOF > /etc/wireguard/wg0.conf
[Interface]
Address = 10.50.0.150/24
ListenPort = 51820
PrivateKey = \$(cat ./privatekey)

[Peer]
PublicKey = XXXXXXX_privatekey_de la machine_2_XXXXXXX
AllowedIPs = 10.50.0.160/32

EOF
systemctl enable --now wg-quick@wg0

Sur la machine 2

apt install wireguard
cd /etc/wireguard/
umask 077; wg genkey | tee privatekey | wg pubkey > publickey
cat <<EOF > /etc/wireguard/wg0.conf
[Interface]
Address = 10.50.0.160/24
PrivateKey = \$(cat ./privatekey)

[Peer]
PublicKey = XXXXXXX_privatekey_de_la_machine_1_XXXXXXX
AllowedIPs = 10.50.0.160/32

EOF
systemctl enable --now wg-quick@wg0


Permalink
  •