Skip to content

Instantly share code, notes, and snippets.

@iamramahibrah
Last active June 30, 2021 19:35
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 iamramahibrah/06a998c357e66138d0fc20bbad77e1a6 to your computer and use it in GitHub Desktop.
Save iamramahibrah/06a998c357e66138d0fc20bbad77e1a6 to your computer and use it in GitHub Desktop.
Wireguard Config File
[Interface]
Address = 192.168.168.1/24 # IPV4 CIDR
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
PrivateKey = sGEPcI+wbFvwq8YwiHluREFbGXa9QzRsfrA8pyLb81A=
ListenPort = 51820
[Peer]
PublicKey = B1Oyq4HertWCcK8YBWETfoHICnFN4+tCfyouxsdhWhs= # Client public key
AllowedIPs = 10.10.0.2/32, fd86:ea04:1111::2/128 # IPs client can connect as
PersistentKeepalive=25
@iamramahibrah
Copy link
Author

How to Generate public and private Keys
umask 077; wg genkey | tee privatekey | wg pubkey >publickey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment