# WG0-server config # Generate keys: # wg genkey | tee privkey_ServerA.key | wg pubkey > pubkey_ServerA.pub # wg genkey | tee privkey_ClientA.key | wg pubkey > pubkey_ClientA.pub # once you have your config setup, normally placed in # /etc/wireguard/wg0.conf, assuming using systemd, run: # # sudo systemctl enable wg-quick@wg0 --now # # to enable automatic starting of the wireguard server on boot, and now #Set address to whatever is routable in your network [Interface] Address = 192.168.99.1/28 PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -A FORWARD -o wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -D FORWARD -o wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE ListenPort = 12345 PrivateKey = Server-Private-Key [Peer] # Laptop PublicKey = Laptop-Public-Key AllowedIPs = 192.168.99.4/32 [Peer] # Laptop 2 PublicKey = Laptop2-Public-Key AllowedIPs = 192.168.99.5/32