Skip to content

Instantly share code, notes, and snippets.

@naufdotal
Last active June 11, 2025 10:35
Show Gist options
  • Select an option

  • Save naufdotal/2f7aa41ee0884c74c66c6176906a7659 to your computer and use it in GitHub Desktop.

Select an option

Save naufdotal/2f7aa41ee0884c74c66c6176906a7659 to your computer and use it in GitHub Desktop.
wireguard wg0 multiple peer, mesh topology
| VPS | Location | Internal IP | IP PUBLIC | Private Key | Public Key |
| ---- | -------- | ----------- | ------------- | ------------- |
| VPS1 | DE | 192.168.1.1 | `IP PUBLIC VPS 1` | `private key` | `public key` |
| VPS2 | NL | 192.168.1.2 | `IP PUBLIC VPS 2` | `private key` | `public key` |
| VPS3 | US | 192.168.1.3 | `IP PUBLIC VPS 3` | `private key` | `public key` |
| VPS4 | JP | 192.168.1.4 | `IP PUBLIC VPS 4` | `private key` | `public key` |
[Interface]
PrivateKey = `private key`
Address = 192.168.1.1/24
ListenPort = 51820
[Peer]
PublicKey = `public key`
Endpoint = `IP PUBLIC VPS 2`:51820
AllowedIPs = 192.168.1.2/32
PersistentKeepalive = 25
[Peer]
PublicKey = `public key`
Endpoint = `IP PUBLIC VPS 3`:51820
AllowedIPs = 192.168.1.3/32
PersistentKeepalive = 25
[Peer]
PublicKey = `public key`
Endpoint = `IP PUBLIC VPS 4`:51820
AllowedIPs = 192.168.1.4/32
PersistentKeepalive = 25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment