31 lines
1.0 KiB
Nix
31 lines
1.0 KiB
Nix
# reference: https://www.procustodibus.com/blog/2022/06/multi-hop-wireguard/#site-gateway-as-a-spoke
|
|
# this configuration is for a device on the home network
|
|
# it exposes the entire home network to outside peers
|
|
|
|
{ip}: {
|
|
networking = {
|
|
firewall.allowedUDPPorts = [56878];
|
|
wg-quick = {
|
|
# enable = true;
|
|
interfaces.wg0 = {
|
|
adress = [ ("192.168.87." + builtins.toString(ip) + "/32")];
|
|
listenPort = 56878;
|
|
privateKeyFile = "/root/wg.keys";
|
|
dns = [ "192.168.178.108" ];
|
|
|
|
peers = [
|
|
{
|
|
# name = "hub";
|
|
publicKey = "XEaJXQW+7llbreoK161NkMhFxlctL1UK8nFiY/GtuC0=";
|
|
allowedIPs = [ "192.168.178.0/24" "192.168.87.127/32" "192.168.87.128/25"];
|
|
endpoint = "173.249.36.74:56878";
|
|
persistentKeepalive = 20;
|
|
}
|
|
];
|
|
};
|
|
};
|
|
};
|
|
}
|
|
|
|
|