lan: new lan for essen

This commit is contained in:
Ingolf Wagner 2020-05-12 22:54:39 +02:00
parent 308ba8463b
commit df06d3225d
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B
4 changed files with 54 additions and 1 deletions

View file

@ -10,6 +10,7 @@
./syncthing.nix ./syncthing.nix
./tinc.nix ./tinc.nix
./wifi-access-point.nix ./wifi-access-point.nix
./lan.nix
./dms.nix ./dms.nix
]; ];

26
configs/pepe/lan.nix Normal file
View file

@ -0,0 +1,26 @@
{ lib, pkgs, ... }:
let
interface = "enp0s25";
ipAddress = "10.1.0.2";
prefixLength = 24;
in {
networking.extraHosts = ''
10.1.0.1 workout.lan
10.1.0.2 pepe.lan
'';
# todo only open needed ports
networking.firewall.trustedInterfaces = [ interface ];
networking.networkmanager.unmanaged = [ interface ];
networking.dhcpcd.denyInterfaces = [ interface ];
networking.interfaces."${interface}".ipv4.addresses = [{
address = ipAddress;
prefixLength = prefixLength;
}];
}

View file

@ -9,7 +9,7 @@
#./slack.nix #./slack.nix
./syncthing.nix ./syncthing.nix
./tinc.nix ./tinc.nix
./lan.nix
]; ];
networking.hostName = "workout"; networking.hostName = "workout";

26
configs/workout/lan.nix Normal file
View file

@ -0,0 +1,26 @@
{ lib, pkgs, ... }:
let
interface = "eno1";
ipAddress = "10.1.0.1";
prefixLength = 24;
in {
networking.extraHosts = ''
10.1.0.1 workout.lan
10.1.0.2 pepe.lan
'';
# todo only open needed ports
networking.firewall.trustedInterfaces = [ interface ];
networking.networkmanager.unmanaged = [ interface ];
networking.dhcpcd.denyInterfaces = [ interface ];
networking.interfaces."${interface}".ipv4.addresses = [{
address = ipAddress;
prefixLength = prefixLength;
}];
}