Created
March 15, 2025 15:53
-
-
Save mortn/12321212fca47b8aef3cff0b60f90783 to your computer and use it in GitHub Desktop.
Wireguard setup with plain systemd networkd
This file contains hidden or 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
# /etc/systemd/network/10-wgsrv.netdev | |
[NetDev] | |
Name=wgsrv | |
Kind=wireguard | |
Description=WireGuard wgsrv | |
[WireGuard] | |
ListenPort=51820 | |
PrivateKeyFile=[path-to-private-key] | |
[WireGuardPeer] | |
# client 1 | |
PublicKey=[client 1 public key] | |
AllowedIPs=0.0.0.0/0 |
This file contains hidden or 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
# /etc/systemd/network/10-wgsrv.network | |
[Match] | |
Name=wgsrv | |
[Network] | |
Address=10.77.0.1/24 |
This file contains hidden or 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
[Interface] | |
Address = 10.77.0.53/24 | |
DNS = [IP of local DNS server], [optional search domain] | |
PrivateKey = [client 1 private key] | |
[Peer] | |
PublicKey = [wgsrv public key] | |
AllowedIPs = 0.0.0.0/0 | |
EndPoint = [public endpoint of the WG server, IP or hostname]:[port number] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment