Skip to content

Instantly share code, notes, and snippets.

@insdavm
Created December 30, 2018 22:04
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 insdavm/4c306150678fe71fa2bf8d64c01c429f to your computer and use it in GitHub Desktop.
Save insdavm/4c306150678fe71fa2bf8d64c01c429f to your computer and use it in GitHub Desktop.
Wireguard server conf for classic VPN server where the LAN and all Internet is accesible
[Interface]
Address = 10.8.1.1
PrivateKey = <SERVER-PRIVATE-KEY>
ListenPort = 51820
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
[Peer]
PublicKey = <CLIENT-1-PUBLIC-KEY>
AllowedIPs = 10.8.1.2/32
[Peer]
PublicKey = <CLIENT-2-PUBLIC-KEY>
AllowedIPs = 10.8.1.3/32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment