Skip to content

Instantly share code, notes, and snippets.

@lanceliao
Last active June 4, 2025 01:42
Show Gist options
  • Save lanceliao/5d2977f417f34dda0e3d63ac7e217fd6 to your computer and use it in GitHub Desktop.
Save lanceliao/5d2977f417f34dda0e3d63ac7e217fd6 to your computer and use it in GitHub Desktop.
Sample WireGuard configuration files
[Interface]
Address = 10.200.200.3/32
PrivateKey = [Client's private key]
DNS = 8.8.8.8
[Peer]
PublicKey = [Server's public key]
PresharedKey = [Pre-shared key, same for server and client]
Endpoint = [Server Addr:Server Port]
AllowedIPs = 0.0.0.0/0
PersistentKeepalive = 21
[Interface]
Address = 10.200.200.1/24
#SaveConfig = true
PostUp = iptables -I FORWARD 1 -i wg0 -j ACCEPT; iptables -I FORWARD 1 -o wg0 -j ACCEPT; iptables -t nat -I POSTROUTING 1 -s 10.200.200.0/24 -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -D FORWARD -o wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -s 10.200.200.0/24 -o eth0 -j MASQUERADE
ListenPort = 10086
PrivateKey = [Server's private key]
[Peer]
# Client 1
PublicKey = [Client's public key]
AllowedIPs = 10.200.200.2/32
PresharedKey = [Pre-shared key, same for server and client]
[Peer]
# Client 2
PublicKey = [Client's public key]
AllowedIPs = 10.200.200.2/32
PresharedKey = [Pre-shared key, same for server and client]
@123JASPE
Copy link

123JASPE commented Jun 7, 2024

How can get a CL ID

@juppw
Copy link

juppw commented Jun 21, 2024

How can get a CL ID

$ wg genkey | tee privatekey | wg pubkey > publickey

@Jontes-Tech
Copy link

Wireguard doesn't have a server-client model. Terminology is incorrect

@polymo1
Copy link

polymo1 commented Mar 25, 2025

Wireguard doesn't have a server-client model. Terminology is incorrect

for some users purposes (such as mine), its good enough.

@polymo1
Copy link

polymo1 commented Mar 25, 2025

Oh, and its the terminology used by Red Hat, so again, its good enough.

@gh0st
Copy link

gh0st commented May 16, 2025

On the wg-server.conf, should the [Interface] Address property match that of say, eth0? Such that it's using the connection on eth0 to receive and send wireguard packets?

@Jontes-Tech
Copy link

On the wg-server.conf, should the [Interface] Address property match that of say, eth0? Such that it's using the connection on eth0 to receive and send wireguard packets?

No, Interface.Adress is always any ip in your wireguard subnet (10.200.200.0/24, in this case 10.200.200.1/24). These configs are hardware connection agnostic, except for endpoints.

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