Skip to content

Wireguard

Install Instructions

sudo su
sudo apt-get -y wireguard
sudo apt-get -y install resolvconf
# Put .conf file in /etc/wireguard
wg-quick up `filename of .conf file` 

Update DNS

vpn - Configure DNS routing in wireguard - Server Fault

Check Status


wg

Start on boot


sudo systemctl enable --now wg-quick@vultr
sudo systemctl disable --now wg-quick@vultr

Only VPN network through VPN

https://chat.openai.com/share/f4c290f0-0bcc-4fe5-9f1a-5bbcfa1d044e

nixos

{
  ...
  networking.wg-quick.interfaces = {
    wg0 = {
      address = [ "10.66.66.18/32" "fd42:42:42::18/128" ];
      dns = [ "1.1.1.1" "1.0.0.1" ];
      privateKeyFile = "/root/wireguard-keys/vultr.PrivateKey";

      peers = [
        {
          publicKey = "vHv8gbhPJ13GytTctHSWbywzVU2uo4OCB2vExy6y62s=";
          presharedKeyFile = "/root/wireguard-keys/vultr.PresharedKey";
          allowedIPs = [ "10.66.66.0/24" "::/0" ];
          endpoint = "66.135.22.253:53394";
          persistentKeepalive = 25;
        }
      ];
    };
  };
  ...
}

Keepalive


PersistentKeepalive = 15

Forward Docker Traffic

Sources