/wireguard-vagrant

wireguard vpn example vagrant environment

Primary LanguagePowerShell

WireGuard

Install the base ubuntu 20.04 vagrant box.

Install the base windows 2019 vagrant box.

Launch the environment:

time vagrant up --provider=libvirt

After the environment is up, each machine wireguard configuration will have all the other machines as peers, e.g., /etc/wireguard/wg0.conf will be:

[Interface]
PrivateKey = +Ps5ijDqZxUtJgXvojG1fMsO6wL3SJixj9s5Glaud3U=
Address = 10.2.0.100/24
ListenPort = 51820

[Peer]
PublicKey = vv0x1c4a93XT0MYhHDHGsxJ2ZZq3uxHugKqj+pa83i0=
Endpoint = 192.168.53.100:51820
AllowedIPs = 10.2.0.100/32

[Peer]
PublicKey = 7S2H6RphXcDLyalL1T/b5Pxmr53137ZmccVRGdgPQDw=
Endpoint = 192.168.53.101:51820
AllowedIPs = 10.2.0.101/32

Ping a machine from node0:

vagrant ssh node0
ping     10.2.0.101 # to wireguard interface.
ping 192.168.53.101 # to non-wireguard interface.

References