Skip to content

Instantly share code, notes, and snippets.

@pashinin
Created April 10, 2026 16:29
Show Gist options
  • Select an option

  • Save pashinin/6767172fcff9926f51681709b4d642c5 to your computer and use it in GitHub Desktop.

Select an option

Save pashinin/6767172fcff9926f51681709b4d642c5 to your computer and use it in GitHub Desktop.
wireguard config
[Interface]
PrivateKey = ****SERVER PRIV KEY****
Address = 10.10.0.1/24
ListenPort = 12345
# substitute eth0 in the following lines to match the Internet-facing interface
# if the server is behind a router and receives traffic via NAT, these iptables rules are not needed
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o enp3s0 -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o enp3s0 -j MASQUERADE
#PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -s 10.10.0.0/24 -o eth0 -j MASQUERADE
#PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -s 10.10.0.0/24 -o eth0 -j MASQUERADE
#[Peer]
#PublicKey = ****CLIENT PUBLIC KEY****
#AllowedIPs = 10.10.0.2/32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment