✳️Replace the highlighted information with your own
SERVER_PUBLIC_IP:
INTERFACE_NAME:
SERVER_PUBLIC_KEY:
SERVER_PRIVATE_KEY:
PUBLIC_KEY_CLIENT:
CLIENT1_PRIVATE_KEY:
apt install vim net-tools qrencode iptables -y
apt install wireguard -y
wg genkey | tee server_private_key | wg pubkey | tee server_public_key
wg genkey | tee client1_private_key | wg pubkey | tee client1_public_key
**********************
******* SERVER *******
**********************
#### WIREGUARD SERVER CONFIGURATION ###
[Interface]
Address = 10.20.10.1/32
ListenPort = 33333
PrivateKey = SERVER_PRIVATE_KEY
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -A FORWARD -o wg0 -j ACCEPT
PostUp = iptables -t nat -A POSTROUTING -o INTERFACE_NAME -j MASQUERADE
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -D FORWARD -o wg0 -j ACCEPT
PostDown = iptables -t nat -D POSTROUTING -o INTERFACE_NAME -j MASQUERADE
#### CLIENT 1 / PEER 1 ###
[Peer]
PublicKey = PUBLIC_KEY_CLIENT_1
AllowedIPs = 10.20.10.11/32
### CLIENT 2 / PEER 2 ###
#[Peer]
#PublicKey = PUBLIC_KEY_CLIENT_2
#AllowedIPs = 10.20.10.12/32
**********************
******* CLIENT *******
**********************
[Interface]
PrivateKey = CLIENT1_PRIVATE_KEY
Address = 10.20.10.2/32
DNS = 1.1.1.1, 8.8.8.8
[Peer]
PublicKey = SERVER_PUBLIC_KEY
Endpoint = SERVER_PUBLIC_IP:33333
AllowedIPs = 0.0.0.0/0
PersistentKeepalive = 25
Read more
- How to Set Up WireGuard VPN Client on Windows
- WireGuard – Set Up a WireGuard VPN Server on a Linux VPS
- How to Upgrade Windows 11 Home to Windows 11 Professional
- How to Self-Host n8n on Windows Using WSL and Docker
- How to Fix the Pairing Required Error in OpenClaw with Docker
- How to Boost Your Raspberry Pi Performance by Booting from USB or External Drive
- Fix the ‘Device Signature Expired’ Error in OpenClaw
- How to Access the OpenClaw Dashboard from ANYWHERE
- Enable Windows Subsystem for Linux (WSL) on Windows
- Banana Pi M2 Zero: A Compact Powerhouse for Your Projects