2022-01-09 21:50:55 +01:00
|
|
|
{ pkgs
|
|
|
|
, lib
|
|
|
|
, config
|
2022-01-12 04:11:18 +01:00
|
|
|
, utils
|
2022-01-09 21:50:55 +01:00
|
|
|
, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
keys = import ../../../variables/keys.nix;
|
2022-01-12 04:11:18 +01:00
|
|
|
passwords = import ../../../variables/passwords.crypt.nix;
|
2022-01-09 21:50:55 +01:00
|
|
|
in {
|
|
|
|
|
|
|
|
# TASK: new device
|
|
|
|
networking.hostName = "fwhost2"; # Define your hostname.
|
|
|
|
|
|
|
|
networking.useDHCP = false;
|
|
|
|
|
|
|
|
networking.firewall.enable = lib.mkForce false;
|
|
|
|
networking.firewall.allowedTCPPorts = [
|
|
|
|
# iperf3
|
|
|
|
5201
|
|
|
|
];
|
|
|
|
|
|
|
|
networking.firewall.logRefusedConnections = false;
|
|
|
|
networking.usePredictableInterfaceNames = false;
|
|
|
|
|
2022-01-12 04:11:18 +01:00
|
|
|
networking.bridges.breth.interfaces = [ "eth0" "eth1" ];
|
2022-01-09 21:50:55 +01:00
|
|
|
|
|
|
|
networking.defaultGateway.address = "172.172.171.10";
|
2022-01-12 04:11:18 +01:00
|
|
|
networking.nameservers = [ "172.172.171.10" ];
|
2022-01-09 21:50:55 +01:00
|
|
|
|
|
|
|
# WAN interfaces, currently unused because the OPNsense guest acts as a router.
|
|
|
|
networking.vlans.wan1.id = 3;
|
2022-01-12 04:11:18 +01:00
|
|
|
networking.vlans.wan1.interface = "breth";
|
2022-01-09 21:50:55 +01:00
|
|
|
networking.interfaces.wan1.ipv4.addresses = [{ address = "192.168.0.16"; prefixLength = 24; } ];
|
|
|
|
|
|
|
|
networking.vlans.wan2.id = 4;
|
2022-01-12 04:11:18 +01:00
|
|
|
networking.vlans.wan2.interface = "breth";
|
2022-01-09 21:50:55 +01:00
|
|
|
networking.interfaces.wan2.ipv4.addresses = [{ address = "172.16.0.16"; prefixLength = 12; } ];
|
|
|
|
|
2022-01-12 04:11:18 +01:00
|
|
|
# Local interfaces, all accessed via VLAN tags on the main bridge
|
2022-01-09 21:50:55 +01:00
|
|
|
networking.vlans.lan.id = 1;
|
2022-01-12 04:11:18 +01:00
|
|
|
networking.vlans.lan.interface = "breth";
|
|
|
|
networking.interfaces.lan.ipv4.addresses = [{ address = "172.172.171.16"; prefixLength = 24; } ];
|
2022-01-09 21:50:55 +01:00
|
|
|
|
|
|
|
networking.vlans.dmz.id = 5;
|
2022-01-12 04:11:18 +01:00
|
|
|
networking.vlans.dmz.interface = "breth";
|
|
|
|
networking.interfaces.dmz.ipv4.addresses = [{ address = "172.172.175.16"; prefixLength = 24; } ];
|
2022-01-09 21:50:55 +01:00
|
|
|
|
|
|
|
networking.vlans.family.id = 6;
|
2022-01-12 04:11:18 +01:00
|
|
|
networking.vlans.family.interface = "breth";
|
|
|
|
networking.interfaces.family.ipv4.addresses = [{ address = "172.172.176.16"; prefixLength = 24; } ];
|
2022-01-09 21:50:55 +01:00
|
|
|
|
|
|
|
networking.vlans.guests.id = 7;
|
2022-01-12 04:11:18 +01:00
|
|
|
networking.vlans.guests.interface = "breth";
|
|
|
|
networking.interfaces.guests.ipv4.addresses = [{ address = "172.172.177.16"; prefixLength = 24; } ];
|
2022-01-09 21:50:55 +01:00
|
|
|
|
|
|
|
services.hostapd = {
|
2022-01-12 04:11:18 +01:00
|
|
|
enable = false;
|
2022-01-09 21:50:55 +01:00
|
|
|
hwMode = "g";
|
2022-01-12 04:11:18 +01:00
|
|
|
interface = "wlan0";
|
|
|
|
ssid = "noowhere-lan";
|
|
|
|
wpaPassphrase = passwords.wifi.noowhere-lan;
|
|
|
|
extraConfig = ''
|
|
|
|
bridge=breth
|
|
|
|
'';
|
2022-01-09 21:50:55 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
virtualisation = {
|
|
|
|
libvirtd = {
|
|
|
|
onShutdown = "shutdown";
|
|
|
|
enable = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
boot.kernelPackages = lib.mkForce pkgs.linuxPackages_latest;
|
|
|
|
}
|
2022-01-12 04:11:18 +01:00
|
|
|
|