https://github.com/lightswitch05/wireguard-docker
A simple docker wireguard client
https://github.com/lightswitch05/wireguard-docker
Last synced: over 1 year ago
JSON representation
A simple docker wireguard client
- Host: GitHub
- URL: https://github.com/lightswitch05/wireguard-docker
- Owner: lightswitch05
- Created: 2020-08-07T16:32:51.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-02-03T03:15:29.000Z (over 2 years ago)
- Last Synced: 2025-01-06T12:52:15.792Z (over 1 year ago)
- Language: Dockerfile
- Size: 6.84 KB
- Stars: 16
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# wireguard-docker
### Setup
* Clone the repo and create a folder named `secrets`.
* Create `wg0.conf` in secrets with all your wireguard configuration, see below for an example.
* Modify `docker-compose.yaml` to put your DNS server IPs. Sorry for hardcoding mine, I didn't really intend to make this repo public.
* Run `docker-compose up -d`
### Example `wg0.conf`
```
[Interface]
Address = 192.168.2.1/24
DNS = 1.1.1.1, 8.8.8.8
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
ListenPort = 51820
PrivateKey = {server's private key}
[Peer] # My phone
PublicKey = {client's public key}
AllowedIPs = 192.168.2.2/32
```