Skip to content

Instantly share code, notes, and snippets.

@arifnd
Last active July 22, 2020 15:19
Show Gist options
  • Select an option

  • Save arifnd/5a026a157becedb4c86b55699c29ca95 to your computer and use it in GitHub Desktop.

Select an option

Save arifnd/5a026a157becedb4c86b55699c29ca95 to your computer and use it in GitHub Desktop.
Wireguard Config
[Interface]
Address = 10.10.10.1/24
PrivateKey =
ListenPort = 10101
#PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o venet0 -j MASQUERADE;
#PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o venet0 -j MASQUERADE;
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o vnet0 -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o vnet0 -j MASQUERADE
[Peer]
PublicKey =
AllowedIPs = 10.10.10.2/32
[Peer]
PublicKey =
AllowedIPs = 10.10.10.6/32
wg genkey | tee privatekey | wg pubkey > publickey
[Interface]
Address = 10.10.10.2/24
PrivateKey =
#DNS = 10.10.10.1
[Peer]
PublicKey =
Endpoint = <server-ip>:10101
AllowedIPs = 10.10.10.0/24
PersistentKeepalive = 25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment