Wireguard Quick Start
2024-03-09 12:48:44
Quick Start
Server:
1 | sudo apt update |
1 | # /etc/wireguard/wg0.conf |
1 | wg-quick up wg0 |
Peer client:
- Same steps but different conf file
1
2
3
4
5
6
7
8
9
10# /etc/wireguard/wg0.conf
[Interface]
PrivateKey = base64_encoded_peer_private_key_goes_here
Address = 10.0.0.2/24
PostUp = ping -c1 10.0.0.1 # Initialize tunnel
[Peer]
PublicKey = base64_encoded_server_public_key
AllowedIPs = 10.0.0.0/24
Endpoint = 192.168.248.129:51820
Finally, add peer to server config
1 | sudo wg set wg0 peer <peer_public_key> allowed-ips 10.0.0.2 |
alternatively, put the following in the server config
1 | ... |
To stop:
1 | sudo systemctl disable wg-quick@wg0 |