1{ lib, ... }:
2{
3 ip4,
4 ip6,
5 extraConfig,
6}:
7lib.mkMerge [
8 {
9 boot.kernel.sysctl = {
10 "net.ipv6.conf.all.forwarding" = "1";
11 "net.ipv6.conf.default.forwarding" = "1";
12 "net.ipv4.ip_forward" = "1";
13 };
14
15 networking.useDHCP = false;
16 networking.interfaces.eth1 = {
17 ipv4.addresses = [
18 {
19 address = ip4;
20 prefixLength = 24;
21 }
22 ];
23 ipv6.addresses = [
24 {
25 address = ip6;
26 prefixLength = 64;
27 }
28 ];
29 };
30 }
31 extraConfig
32]