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

https://github.com/linkdata/wgnet

WireGuard ContextDialer
https://github.com/linkdata/wgnet

go golang wireguard

Last synced: 8 months ago
JSON representation

WireGuard ContextDialer

Awesome Lists containing this project

README

          

[![build](https://github.com/linkdata/wgnet/actions/workflows/build.yml/badge.svg)](https://github.com/linkdata/wgnet/actions/workflows/build.yml)
[![coverage](https://coveralls.io/repos/github/linkdata/wgnet/badge.svg?branch=main)](https://coveralls.io/github/linkdata/wgnet?branch=main)
[![goreport](https://goreportcard.com/badge/github.com/linkdata/wgnet)](https://goreportcard.com/report/github.com/linkdata/wgnet)
[![Docs](https://godoc.org/github.com/linkdata/wgnet?status.svg)](https://godoc.org/github.com/linkdata/wgnet)

# wgnet

WireGuard ContextDialer for Go.

## Setting up a Wireguard exit node on Debian/Ubuntu

### Install software and generate keys for exit node

```sh
apt install firewalld wireguard
wg genkey | tee /etc/wireguard/wg_private.key | wg pubkey | tee /etc/wireguard/wg_public.key
```

### Create configuration file

`nano /etc/wireguard/wg0.conf`

```conf
[Interface]
Address = 10.99.0.1/24
SaveConfig = true
ListenPort = 51820
PrivateKey =
```

### Configure firewall

```sh
firewall-cmd --permanent --zone public --add-interface=
firewall-cmd --permanent --zone public --add-masquerade
firewall-cmd --permanent --zone public --add-port=51820/udp
firewall-cmd --reload
```

### Start and set wireguard to start on boot

```sh
wg-quick up wg0
systemctl enable wg-quick@wg0
```

### Add the clients that will use the exit node

```
wg set wg0 peer allowed-ips 10.99.0.2
wg set wg0 peer allowed-ips 10.99.0.3

wg-quick save wg0
```