feat(tyr): add wireguard.
This commit is contained in:
parent
ca9651efb8
commit
6a2f621080
31 changed files with 124 additions and 89 deletions
|
@ -3,5 +3,7 @@
|
|||
./syncthing.nix
|
||||
./glance.nix
|
||||
./wallos.nix
|
||||
./wireguard.nix
|
||||
./secrets.nix
|
||||
];
|
||||
}
|
||||
|
|
9
modules/servers/tyr/secrets.nix
Normal file
9
modules/servers/tyr/secrets.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
age = {
|
||||
secrets = {
|
||||
wg-tyr = {
|
||||
file = ../../../secrets/wg-tyr.age;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
17
modules/servers/tyr/wireguard.nix
Normal file
17
modules/servers/tyr/wireguard.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
{config, ...}: {
|
||||
networking = {
|
||||
nat = {
|
||||
enable = true;
|
||||
enableIPv6 = true;
|
||||
externalInterface = "enp1s0";
|
||||
internalInterfaces = ["wg0"];
|
||||
};
|
||||
firewall = {
|
||||
allowedTCPPorts = [53];
|
||||
allowedUDPPorts = [53 51820];
|
||||
};
|
||||
wg-quick.interfaces.wg0.configFile = "${config.age.secrets.wg-tyr.path}";
|
||||
};
|
||||
|
||||
boot.kernel.sysctl."net.ipv4.ip_forward" = 1;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue