Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/michaelbeaumont/livewire

Livewire makes it easy to set up an ephemeral VPN using wireguard.
https://github.com/michaelbeaumont/livewire

gcp wireguard wireguard-vpn

Last synced: 23 days ago
JSON representation

Livewire makes it easy to set up an ephemeral VPN using wireguard.

Awesome Lists containing this project

README

        

# Livewire

Livewire makes it easy to set up an ephemeral VPN using wireguard
running in GCP. It uses
[michaelbeaumont/wireform](https://github.com/michaelbeaumont/wireform)
to setup a GCP VM with wireguard and generate the private key entirely in the
VM, exporting only the public key.

It requires `wg` and `terraform`.
Python dependencies are managed using `poetry`.

```
$ poetry install
$ poetry run ./main.py init
$ poetry run ./main.py up -o wg0.conf -t wg0.tmpl
```

## Config

Configure livewire with a `config.json` file in `${XDG_CONFIG_HOME}/livewire`
and replace `<...>`s:

```
{
"init": {
"region": "us-east1",
"billing_account": ""
},
"instance": {
"source_ranges": [
""
],
"client": {
"public_key": "",
// or: "private_key": "",
"allowed_ips": ""
},
"other_peers": []
}
}
```

along with a template `conf.tmpl` for _your client_ `wg-quick` config
(`{...}`s are replaced by `livewire`):

```
[Interface]
Address =
{interface_extra} # important for MTU issues with GCP
PrivateKey = {private_key} # if you put it in the livewire config
DNS = 1.1.1.1

PreUp = ./wg-vpn PreUp
PostUp = ./wg-vpn PostUp
PreDown = ./wg-vpn PreDown
PostDown = ./wg-vpn PostDown

[Peer]
PublicKey = {peer.public_key} # generated on the peer in GCP
Endpoint = {peer.ip}:{peer.port} # IP of peer in GCP
AllowedIPs = 0.0.0.0/0 # route all traffic through this peer
```