2024-02-03 20:02:15 +01:00
|
|
|
{ config, lib, ... }:
|
2022-12-09 16:18:57 +01:00
|
|
|
{
|
2024-10-04 16:34:54 +02:00
|
|
|
sops.secrets."wg-ese" = {
|
|
|
|
owner = config.users.users.systemd-network.name;
|
|
|
|
};
|
2022-12-09 16:18:57 +01:00
|
|
|
networking = {
|
2024-02-03 20:02:15 +01:00
|
|
|
# portunus module does weird things to this, so we force it to some sane values
|
|
|
|
hosts = {
|
2024-02-03 20:03:45 +01:00
|
|
|
"127.0.0.1" = lib.mkForce [ "quitte.ifsr.de" "quitte" ];
|
|
|
|
"::1" = lib.mkForce [ "quitte.ifsr.de" "quitte" ];
|
2024-02-03 20:02:15 +01:00
|
|
|
};
|
2022-12-09 16:18:57 +01:00
|
|
|
hostId = "a71c81fc";
|
2023-09-17 20:10:55 +02:00
|
|
|
domain = "ifsr.de";
|
|
|
|
hostName = "quitte";
|
|
|
|
rDNS = config.networking.fqdn;
|
2022-12-09 16:18:57 +01:00
|
|
|
useNetworkd = true;
|
2023-10-23 11:59:12 +02:00
|
|
|
nftables.enable = true;
|
2022-12-09 16:18:57 +01:00
|
|
|
|
2023-11-14 14:00:22 +01:00
|
|
|
firewall = {
|
|
|
|
logRefusedConnections = false;
|
2024-10-04 16:34:54 +02:00
|
|
|
allowedUDPPorts = [ 10000 ];
|
2023-11-14 14:00:22 +01:00
|
|
|
};
|
2022-12-09 16:18:57 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
services.resolved = {
|
|
|
|
enable = true;
|
2024-03-21 15:47:32 +01:00
|
|
|
fallbackDns = [ "9.9.9.9" ];
|
2022-12-09 16:18:57 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
systemd.network = {
|
|
|
|
enable = true;
|
2024-03-21 15:47:32 +01:00
|
|
|
wait-online.anyInterface = true;
|
2022-12-09 16:18:57 +01:00
|
|
|
|
|
|
|
# Interfaces on the machine
|
2024-01-29 16:23:56 +01:00
|
|
|
networks."10-wired-default" = {
|
2024-03-28 18:06:41 +01:00
|
|
|
matchConfig.Name = "enp65s0f0np0";
|
2023-02-15 13:34:14 +01:00
|
|
|
|
|
|
|
address = [ "141.30.30.169/25" ];
|
|
|
|
routes = [
|
2023-02-15 13:35:32 +01:00
|
|
|
{
|
|
|
|
routeConfig.Gateway = "141.30.30.129";
|
|
|
|
}
|
2023-02-15 13:34:14 +01:00
|
|
|
];
|
2022-12-09 16:18:57 +01:00
|
|
|
networkConfig = {
|
|
|
|
DNS = "141.30.1.1";
|
2024-03-28 23:49:49 +01:00
|
|
|
LLDP = true;
|
|
|
|
EmitLLDP = "nearest-bridge";
|
2022-12-09 16:18:57 +01:00
|
|
|
};
|
|
|
|
};
|
2024-10-04 16:34:54 +02:00
|
|
|
netdevs."30-wireguard-ese" = {
|
|
|
|
netdevConfig = {
|
|
|
|
Kind = "wireguard";
|
|
|
|
Name = "wg0";
|
|
|
|
};
|
|
|
|
wireguardConfig = {
|
|
|
|
PrivateKeyFile = config.sops.secrets."wg-ese".path;
|
|
|
|
ListenPort = 10000;
|
|
|
|
RouteTable = "main";
|
|
|
|
RouteMetric = 30;
|
|
|
|
};
|
|
|
|
wireguardPeers = [
|
|
|
|
|
|
|
|
{
|
|
|
|
wireguardPeerConfig = {
|
|
|
|
|
|
|
|
PublicKey = "gTWcZ8dAb735kY0vs/LwnBdap5J6+eeHAsLXCu+C52M=";
|
|
|
|
AllowedIPs = "10.20.24.2/24";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
2024-10-04 15:39:10 +02:00
|
|
|
};
|
2024-10-04 16:34:54 +02:00
|
|
|
networks."30-wireguard-ese" = {
|
|
|
|
matchConfig.Name = "wg0";
|
|
|
|
address = [ "10.20.24.1/24" ];
|
|
|
|
# networkConfig = {
|
|
|
|
# DNSSEC = false;
|
|
|
|
# BindCarrier = [ "ens3" ];
|
|
|
|
# };
|
2024-10-04 15:39:10 +02:00
|
|
|
};
|
|
|
|
};
|
2022-12-09 16:18:57 +01:00
|
|
|
}
|