2 with (import ./names-and-numbers.nix);
3 with (import ./names-and-numbers.nix.clear);
5 networking.interfaces = {
8 ipv4.addresses = [{ address = "${eth1IPv4}.1"; prefixLength = 24; }];
12 ipv4.addresses = [{ address = "${eth2IPv4}.1"; prefixLength = 24; }];
16 ipv4.addresses = [{ address = "${eth3IPv4}.1"; prefixLength = 24; }];
19 networking.networkmanager = {
26 networking.nftables.ruleset = lib.mkAfter ''
29 iifname { ${eth1Iface}, ${eth2Iface}, ${eth3Iface} } jump input-lan
30 iifname { ${eth1Iface}, ${eth2Iface}, ${eth3Iface} } log level warn prefix "input-lan: " counter drop
33 oifname { ${eth1Iface}, ${eth2Iface}, ${eth3Iface} } jump output-lan
34 oifname { ${eth1Iface}, ${eth2Iface}, ${eth3Iface} } log level warn prefix "output-lan: " counter drop
36 chain forward-to-lan { }
38 iifname { "enp2s0", "enp3s0", "enp4s0", "wlp5s0" } oifname { "enp2s0", "enp3s0", "enp4s0", "wlp5s0" } goto forward-to-lan
43 systemd.services.dhcpd4.onFailure = [
44 "network-addresses-${eth1Iface}.service"
45 "network-addresses-${eth2Iface}.service"
46 "network-addresses-${eth3Iface}.service"
56 subnet ${eth1IPv4}.0 netmask 255.255.255.0 {
57 range ${eth1IPv4}.100 ${eth1IPv4}.200;
58 option broadcast-address ${eth1IPv4}.255;
59 option domain-name-servers ${eth1IPv4}.1;
60 option routers ${eth1IPv4}.1;
61 option subnet-mask 255.255.255.0;
64 hardware ethernet ${patateMAC};
65 fixed-address ${eth1IPv4}.3;
70 subnet ${eth2IPv4}.0 netmask 255.255.255.0 {
71 range ${eth2IPv4}.100 ${eth2IPv4}.200;
72 option broadcast-address ${eth2IPv4}.255;
73 option domain-name-servers ${eth2IPv4}.1;
74 option routers ${eth2IPv4}.1;
75 option subnet-mask 255.255.255.0;
78 hardware ethernet ${patateMAC};
79 fixed-address ${eth2IPv4}.3;
84 subnet ${eth3IPv4}.0 netmask 255.255.255.0 {
85 range ${eth3IPv4}.100 ${eth3IPv4}.200;
86 option broadcast-address ${eth3IPv4}.255;
87 option domain-name-servers ${eth3IPv4}.1;
88 option routers ${eth3IPv4}.1;
89 option subnet-mask 255.255.255.0;
92 hardware ethernet ${patateMAC};
93 fixed-address ${eth3IPv4}.3;