https://github.com/linkdata/wgnet
WireGuard ContextDialer
https://github.com/linkdata/wgnet
go golang wireguard
Last synced: 8 months ago
JSON representation
WireGuard ContextDialer
- Host: GitHub
- URL: https://github.com/linkdata/wgnet
- Owner: linkdata
- Created: 2025-03-10T11:08:50.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-10T11:15:50.000Z (about 1 year ago)
- Last Synced: 2025-03-10T12:26:14.179Z (about 1 year ago)
- Topics: go, golang, wireguard
- Language: Go
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://github.com/linkdata/wgnet/actions/workflows/build.yml)
[](https://coveralls.io/github/linkdata/wgnet?branch=main)
[](https://goreportcard.com/report/github.com/linkdata/wgnet)
[](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
```