Skip to content

Instantly share code, notes, and snippets.

@vkobel
Created June 23, 2018 16:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vkobel/b4f003ac72410b7cc7788fcdf8046641 to your computer and use it in GitHub Desktop.
Save vkobel/b4f003ac72410b7cc7788fcdf8046641 to your computer and use it in GitHub Desktop.
Wireguard config example (VPN home)
[Interface]
Address = 10.0.0.2/24
PrivateKey = <Client 1 Priv Key>
[Peer]
PublicKey = <Server Pub Key>
Endpoint = <Server Public IP>:51820
AllowedIPs = 0.0.0.0/0
PersistentKeepalive = 25
[Interface]
Address = 10.0.0.3/24
PrivateKey = <Client 2 Priv Key>
[Peer]
PublicKey = <Server Pub Key>
Endpoint = <Server Public IP>:51820
AllowedIPs = 0.0.0.0/0
PersistentKeepalive = 25
[Interface]
Address = 10.0.0.1/24
PostUp = iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE; iptables -A FORWARD -i wg0 -j ACCEPT
PostDown = iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE; iptables -D FORWARD -i wg0 -j ACCEPT
ListenPort = 51820
PrivateKey = <Server Priv Key>
[Peer]
PublicKey = <Client 1 Pub Key>
AllowedIPs = 10.0.0.0/24
[Peer]
PublicKey = <Client 2 Pub Key>
AllowedIPs = 10.0.0.0/24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment