Skip to content

Instantly share code, notes, and snippets.

@apsun
Last active February 21, 2022 06:22
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 apsun/1617bf780781aa43bfe9e0eea13947e9 to your computer and use it in GitHub Desktop.
Save apsun/1617bf780781aa43bfe9e0eea13947e9 to your computer and use it in GitHub Desktop.
Example WireGuard configuration
[Interface]
PrivateKey = <REDACTED>
Address = 10.19.84.2/32,fd07:d3fc:8a02::2/128
DNS = 10.19.84.1,fd07:d3fc:8a02::1
MTU = 1280
[Peer]
PublicKey = <REDACTED>
PresharedKey = <REDACTED>
AllowedIPs = 0.0.0.0/0,::/0
Endpoint = <SERVER HOSTNAME>:1337
[Interface]
PrivateKey = <REDACTED>
ListenPort = 1337
Address = 10.19.84.1/24,fd07:d3fc:8a02::1/48
MTU = 1280
PostUp = iptables -A FORWARD -i %i -j ACCEPT
PostUp = iptables -A FORWARD -o %i -j ACCEPT
PostUp = iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostUp = ip6tables -A FORWARD -i %i -j ACCEPT
PostUp = ip6tables -A FORWARD -o %i -j ACCEPT
PostUp = ip6tables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PreDown = iptables -D FORWARD -i %i -j ACCEPT
PreDown = iptables -D FORWARD -o %i -j ACCEPT
PreDown = iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
PreDown = ip6tables -D FORWARD -i %i -j ACCEPT
PreDown = ip6tables -D FORWARD -o %i -j ACCEPT
PreDown = ip6tables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
[Peer]
PublicKey = <REDACTED>
PresharedKey = <REDACTED>
AllowedIPs = 10.19.84.2/32,fd07:d3fc:8a02::2/128
[Peer]
PublicKey = <REDACTED>
PresharedKey = <REDACTED>
AllowedIPs = 10.19.84.3/32,fd07:d3fc:8a02::3/128
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment