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 = {
27 networking.nftables.ruleset = lib.mkAfter ''
30 iifname { ${eth1Iface}, ${eth2Iface}, ${eth3Iface} } jump input-lan
31 iifname { ${eth1Iface}, ${eth2Iface}, ${eth3Iface} } log level warn prefix "input-lan: " counter drop
34 oifname { ${eth1Iface}, ${eth2Iface}, ${eth3Iface} } jump output-lan
35 oifname { ${eth1Iface}, ${eth2Iface}, ${eth3Iface} } log level warn prefix "output-lan: " counter drop
37 chain forward-to-lan { }
39 iifname { "enp2s0", "enp3s0", "enp4s0", "wlp5s0" } oifname { "enp2s0", "enp3s0", "enp4s0", "wlp5s0" } goto forward-to-lan
44 systemd.services.dhcpd4.onFailure = [
45 "network-addresses-${eth1Iface}.service"
46 "network-addresses-${eth2Iface}.service"
47 "network-addresses-${eth3Iface}.service"
57 subnet ${eth1IPv4}.0 netmask 255.255.255.0 {
58 range ${eth1IPv4}.100 ${eth1IPv4}.200;
59 option broadcast-address ${eth1IPv4}.255;
60 option domain-name-servers ${eth1IPv4}.1;
61 option routers ${eth1IPv4}.1;
62 option subnet-mask 255.255.255.0;
65 hardware ethernet ${patateMAC};
66 fixed-address ${eth1IPv4}.3;
71 subnet ${eth2IPv4}.0 netmask 255.255.255.0 {
72 range ${eth2IPv4}.100 ${eth2IPv4}.200;
73 option broadcast-address ${eth2IPv4}.255;
74 option domain-name-servers ${eth2IPv4}.1;
75 option routers ${eth2IPv4}.1;
76 option subnet-mask 255.255.255.0;
79 hardware ethernet ${patateMAC};
80 fixed-address ${eth2IPv4}.3;
85 subnet ${eth3IPv4}.0 netmask 255.255.255.0 {
86 range ${eth3IPv4}.100 ${eth3IPv4}.200;
87 option broadcast-address ${eth3IPv4}.255;
88 option domain-name-servers ${eth3IPv4}.1;
89 option routers ${eth3IPv4}.1;
90 option subnet-mask 255.255.255.0;
93 hardware ethernet ${patateMAC};
94 fixed-address ${eth3IPv4}.3;