summaryrefslogtreecommitdiff
path: root/router.nix
diff options
context:
space:
mode:
Diffstat (limited to 'router.nix')
-rw-r--r--router.nix72
1 files changed, 37 insertions, 35 deletions
diff --git a/router.nix b/router.nix
index 3c75169..2285c84 100644
--- a/router.nix
+++ b/router.nix
@@ -5,22 +5,44 @@ let
in
{
boot.kernel.sysctl."net.ipv4.conf.all.forwarding" = true;
- networking.nftables.enable = true;
- networking.firewall.filterForward = true;
- networking.nat = {
+
+ networking = {
+ nftables.enable = true;
+ firewall.filterForward = true;
+ nat = {
+ enable = true;
+ externalInterface = "enp8s0";
+ internalInterfaces = [ "br0" ];
+ # forwardPorts = [{ sourcePort = 1234; destination = "10.69.0.2:12345"; }];
+ };
+ bridges.br0.interfaces = [ lanInterface wifiInterface ];
+ interfaces.br0.ipv4.addresses = [{
+ address = "10.69.0.1";
+ prefixLength = 16;
+ }];
+ networkmanager = {
+ enable = true;
+ unmanaged = [ "interface-name:${lanInterface}" "interface-name:${wifiInterface}" ];
+ };
+ };
+ services.hostapd = {
enable = true;
- externalInterface = "enp8s0";
- internalInterfaces = [ "br0" ];
- # forwardPorts = [{
- # sourcePort = 1234;
- # destination = "10.69.0.2:12345";
- # }];
+ radios.${wifiInterface} = {
+ countryCode = "SE";
+ band = "2g";
+ channel = 12;
+ networks.${wifiInterface} = {
+ ssid = "Heidrun";
+ authentication = {
+ mode = "wpa3-sae";
+ saePasswords = [
+ { password = "REDACTED"; }
+ ];
+ };
+ };
+ };
};
- networking.bridges.br0.interfaces = [ lanInterface wifiInterface ];
- networking.interfaces.br0.ipv4.addresses = [{
- address = "10.69.0.1";
- prefixLength = 16;
- }];
+
services.kea.dhcp4 = {
enable = true;
settings = {
@@ -49,25 +71,5 @@ in
}];
};
};
- networking.networkmanager = {
- enable = true;
- unmanaged = [ "interface-name:${lanInterface}" "interface-name:${wifiInterface}" ];
- };
- services.hostapd = {
- enable = true;
- radios.${wifiInterface} = {
- countryCode = "SE";
- band = "2g";
- channel = 12;
- networks.${wifiInterface} = {
- ssid = "Heidrun";
- authentication = {
- mode = "wpa3-sae";
- saePasswords = [
- { password = "REDACTED"; }
- ];
- };
- };
- };
- };
+ oden.persist.directories = [ "/var/lib/private/kea" ];
}