Wireguard
Server
Step 1 — Installing WireGuard and Generating a Key Pair
Step 2 — Choosing IPv4 and IPv6 Addresses
Step 3 — Creating a WireGuard Server Configuration
Step 4 — Adjusting the WireGuard Server’s Network Configuration
Step 5 — Configuring the WireGuard Server’s Firewall
At the bottom of the file after the SaveConfig = true
line, paste the following lines:
Step 6 — Starting the WireGuard Server
Peer
Creating the WireGuard Peer’s Configuration File
Add the following lines to the file, substituting in the various data into the highlighted sections as required:
The first key is the private key generated on the peer. The first address line uses an IPv4 address from the subnet chosen earlier. The second address line uses an IPv6 address from the subnet chosen earlier.
The second key is the public key generated on the server. The AllowedIPs
uses the IPv4 and IPv6 ranges chosen before that instruct the peer to only send traffic over the VPN if the destination system has an IP address in either range. You can omit the IPv6 addresses if you are only using the IPv4 connection.
Adding the Peer's Public Key to the Wireguard Server
Check the public key on the Wireguard peer.
Run the following command on your Wireguard server.
To update the allowed-ips
for an existing peer, run the above command again by changing the IP address.
Check the status of the tunnel on the server.
Last updated