Archived
1
0
forked from rarias/bscpkgs

Add wireguard server in fox

Reviewed-by: Aleix Roca Nonell <aleix.rocanonell@bsc.es>
This commit is contained in:
2025-08-29 13:38:47 +02:00
parent 200c727bbf
commit e415f70bbb
5 changed files with 40 additions and 0 deletions

View File

@@ -6,6 +6,7 @@
../common/xeon/console.nix
../module/emulation.nix
../module/nvidia.nix
./wireguard.nix
];
# Don't turn off on August as UPC has different dates.

35
m/fox/wireguard.nix Normal file
View File

@@ -0,0 +1,35 @@
{ config, ... }:
{
networking.firewall = {
allowedUDPPorts = [ 666 ];
};
age.secrets.wgFox.file = ../../secrets/wg-fox.age;
networking.wireguard.enable = true;
networking.wireguard.interfaces = {
# "wg0" is the network interface name. You can name the interface arbitrarily.
wg0 = {
# Determines the IP address and subnet of the server's end of the tunnel interface.
ips = [ "10.100.0.1/24" ];
# The port that WireGuard listens to. Must be accessible by the client.
listenPort = 666;
# Path to the private key file.
privateKeyFile = config.age.secrets.wgFox.path;
# Public key: VfMPBQLQTKeyXJSwv8wBhc6OV0j2qAxUpX3kLHunK2Y=
peers = [
# List of allowed peers.
{
name = "Apex";
publicKey = "VwhcN8vSOzdJEotQTpmPHBC52x3Hbv1lkFIyKubrnUA=";
# List of IPs assigned to this peer within the tunnel subnet. Used to configure routing.
allowedIPs = [ "10.100.0.30/32" ];
}
];
};
};
}