Switch bachtel to new router role

This commit is contained in:
Fabian Hauser 2020-07-16 23:22:13 +02:00
parent cf56883882
commit 8ad8d5a8ff

View file

@ -2,36 +2,17 @@
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }: { config, pkgs, ... }: {
let
routerConfig = {
wanInterface = "wwp0s19u1u3i12";
wireless = {
wleInterface = "wlp5s0";
wleSSID = "hauser";
wlePassphrase = "mifatielma";
};
lanInterfaces = [ "enp1s0" "enp2s0" "enp3s0" "enp4s0" ];
lanNetwork = {
routerAddress = "10.2.1.1";
netid = "10.2.1.0";
revIpDomain = "1.2.10";
prefixLength = 24;
domain = "rappi.fh2.ch";
dhcpRange = "10.2.1.2,10.2.1.249";
routerHostName = "bachtel";
};
};
in {
imports = [ imports = [
../hardware/apu.nix ../hardware/apu.nix
../hardware/wle900vx.nix ../hardware/wle900vx.nix
../role/base ../role/base
../role/wwan ../role/wwan
(import ../role/router routerConfig) ../role/router
../role/router-dhcp
../role/router-dns
../role/router-wireless-ap
]; ];
fileSystems."/" = { fileSystems."/" = {
@ -46,7 +27,31 @@ in {
services.wwan = { services.wwan = {
enable = true; enable = true;
apn = "gprs.swisscom.ch"; apn = "gprs.swisscom.ch";
networkInterface = routerConfig.wanInterface; networkInterface = "wwp0s19u1u3i12";
};
services.router = {
enable = true;
wanInterface = "wwp0s19u1u3i12";
wirelessInterfaces = [ "wlp5s0" ];
lanInterfaces = [ "enp1s0" "enp2s0" "enp3s0" "enp4s0" ];
internalRouterIP = "10.2.1.1";
dhcp = {
enable = true;
localDomain = "rappi.fh2.ch";
dhcpRange = "10.2.1.2,10.2.1.249";
};
recursiveDns = {
enable = true;
networkIdIp = "10.2.1.0";
};
wireless = {
enable = true;
#wleInterface24Ghz = "wlp4s0";
wleInterface5Ghz = "wlp5s0";
ssid = "hauser";
passphrase = "mifatielma";
};
}; };
# Use the GRUB 2 boot loader. # Use the GRUB 2 boot loader.
@ -58,8 +63,7 @@ in {
# Define on which hard drive you want to install Grub. # Define on which hard drive you want to install Grub.
boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only
networking.hostName = networking.hostName = "bachtel"; # Define your hostname.
routerConfig.lanNetwork.routerHostName; # Define your hostname.
#networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. #networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
#networking.wireless.networks = { #networking.wireless.networks = {
# yummi = { # yummi = {