change wireguard config to include DNS

This commit is contained in:
2026-05-13 11:11:43 +02:00
parent db8c11c83a
commit 07531e3691
2 changed files with 6 additions and 5 deletions
+1 -1
View File
@@ -64,7 +64,7 @@
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`. # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true; networking.useDHCP = lib.mkDefault true;
# make custom dns work while gracefully falling back on public servers # make custom dns work while gracefully falling back on public servers
networking.networkmanager.insertNameservers = [ "192.168.178.108" ]; # networking.networkmanager.insertNameservers = [ "192.168.178.108" ];
# networking.interfaces.enp4s0f3u1u4u1.useDHCP = lib.mkDefault true; # networking.interfaces.enp4s0f3u1u4u1.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true; # networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true;
+5 -4
View File
@@ -5,16 +5,17 @@
{ip}: { {ip}: {
networking = { networking = {
firewall.allowedUDPPorts = [56878]; firewall.allowedUDPPorts = [56878];
wireguard = { wg-quick = {
enable = true; # enable = true;
interfaces.wg0 = { interfaces.wg0 = {
ips = [ ("192.168.87." + builtins.toString(ip) + "/32")]; adress = [ ("192.168.87." + builtins.toString(ip) + "/32")];
listenPort = 56878; listenPort = 56878;
privateKeyFile = "/root/wg.keys"; privateKeyFile = "/root/wg.keys";
dns = [ "192.168.178.108" ];
peers = [ peers = [
{ {
name = "hub"; # name = "hub";
publicKey = "XEaJXQW+7llbreoK161NkMhFxlctL1UK8nFiY/GtuC0="; publicKey = "XEaJXQW+7llbreoK161NkMhFxlctL1UK8nFiY/GtuC0=";
allowedIPs = [ "192.168.178.0/24" "192.168.87.127/32" "192.168.87.128/25"]; allowedIPs = [ "192.168.178.0/24" "192.168.87.127/32" "192.168.87.128/25"];
endpoint = "173.249.36.74:56878"; endpoint = "173.249.36.74:56878";