Last active
December 22, 2023 20:00
-
-
Save superstes/ffee4af63fd2303bc2e1794312ef9e6b to your computer and use it in GitHub Desktop.
Basic WireGuard Client/Server Config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### BASIC ### | |
GEN KEYS: wg genkey | tee privatekey | wg pubkey > publickey | |
ADD CONFIG: /etc/wireguard/<CONFIG>.conf | |
ADD SERVICE: systemctl start wg-quick@<CONFIG>.service | |
EN SERVICE: systemctl enable wg-quick@<CONFIG>.service | |
### SERVER ### | |
[Interface] | |
Address = 10.0.1.1/24 | |
ListenPort = <SRV-PORT> | |
PrivateKey = <SRV-KEY> | |
MTU = 1400 | |
[Peer] | |
# <COMMENT> | |
PublicKey = <CLI-PUB> | |
#PresharedKey = <PSK> | |
PersistentKeepalive = 3 | |
AllowedIPs = 10.0.1.10/32 | |
### CLIENT ### | |
[Interface] | |
Address = 10.0.1.10/24 | |
PrivateKey = <CLI-KEY> | |
MTU = 1400 | |
# make sure dynamic endpoints reconnect | |
PostUp = /bin/bash -c "while sleep 30; do ping -c4 10.0.1.1 > /dev/null 2>&1" | |
[Peer] | |
# <COMMENT> | |
Endpoint = <SRV-IP>:<SRV-PORT> | |
PublicKey = <SRV-PUB> | |
#PresharedKey = <PSK> | |
PersistentKeepalive = 3 | |
AllowedIPs = 10.0.1.1/32, 10.0.0.0/24 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment